using an egg module in a python (jython) server extension?

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
Zak
Posts: 13
Joined: 04 Mar 2008, 07:41
Location: Las Vegas
Contact:

using an egg module in a python (jython) server extension?

Post by Zak »

Hello,

I have been trying to use pydao http://aplikacja.info/PyDAO.html, which depends on the python module: MySQLdb (http://mysql-python.sourceforge.net/MyS ... ml#mysqldb).

MySQLdb installs using a build script, and installs the missing _mysql module to /usr/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-i686.egg


It works fine from the normal cli python installed on my box, but won't be found from the magical jython built into sfs. I have tried to put pydao and MySQLdb files in sfsExtensions, and even sys.path.append("/usr/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-i686.egg")

or sys.path.append("/usr/lib/python2.4/site-packages")

but am still getting "/home/myhomedir/sfs/SFS_PRO_1.6.2/Server/sfsExtensions/MySQLdb/__init__.py", line 19, in ?
ImportError: no module named _mysql whenever I try to use pydao or MySQLdb modules from sfs's jython.


How do I get smartfox to import this module, or at least extract the _mysql.py file from the egg?

Any help is appreciated. Thank you everybody. :)

8)
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

I don't think it's possible for a few reasons:

1. the implementation of python we use is based on Java (jython) and it supports Python 2.2
2. being java based it's not possible to use libraries made in CPython
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply