[PD] py/mysql

Dafydd Hughes dafydd61 at gmail.com
Thu Jun 10 03:46:29 CEST 2010


Thanks for your help, Charles. Yes - it turned out to be an architecture thing. It looks like Pd forces Python into 32-bits, and so mysql needs to be 32 bit, as well as MySQLdb. Once I reinstalled the server and rebuilt the library all 32-bit, it worked like a charm.

Is there a 64-bit osx version of Pd kicking around, or is it difficult to build? No, wait. I'll look it up first:)

cheers
dafydd

On 2010-06-09, at 4:50 PM, Charles Henry wrote:

> Okay, my situation has been somewhat different, after all.  I am
> running into architecture related problems with libraries.  In
> particular, I was able to diagnose the problem using the file and
> dyldinfo commands.  The library you (probably) need to find is
> _mysql.so and take a look at what the library does.
> 
> file _mysql.so
> _mysql.so: Mach-O universal binary with 2 architectures
> _mysql.so (for architecture i386):	Mach-O bundle i386
> _mysql.so (for architecture ppc):	Mach-O bundle ppc
> 
> dyldinfo -arch i386 -export _mysql.so
> which shows me a full table of exported symbols.
> 
> however,
> dyldinfo -arch x86_64 -export _mysql.so is empty
> and so is the table printed by:
> dyldinfo -arch ppc -export _mysql.so
> 
> I hope that helps somewhat.
> Chuck
> 
> 
> On Wed, Jun 9, 2010 at 2:39 PM, Charles Henry <czhenry at gmail.com> wrote:
>> I am just now debugging a completely different application at work
>> (CellProfiler Analyst), and trying to figure out this same error.
>> 
>> The application is pre-compiled, and the *.pyc files are put into
>> site-packages.zip.  It retrieves the correct files from the archive,
>> but then complains about not having the init_mysql function.  I also
>> am running a 32-bit application on a 64-bit capable machine.
>> 
>> Chuck
>> 
>> On Wed, Jun 9, 2010 at 12:45 PM, Dafydd Hughes <dafydd61 at gmail.com> wrote:
>>> Hey everybody
>>> 
>>> It's been a while - I hope everybody's good.
>>> 
>>> Having a bit of an issue, and hoping somebody can help. I'm trying to use py in pd-extended 0.41.4 to add to a mysql db table using MySQLdb. The python script works fine on its own, but once I get it into py I get the following errors:
>>> 
>>> py - No namespace available
>>> Traceback (most recent call last):
>>>  File "/Users/dafydd/Documents/pd/Sound Sorter/db_add.py", line 1, in <module>
>>>    import MySQLdb
>>>  File "build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py", line 19, in <module>
>>>  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 7, in <module>
>>>  File "build/bdist.macosx-10.6-universal/egg/_mysql.py", line 6, in __bootstrap__
>>> ImportError: dynamic module does not define init function (init_mysql)
>>> 
>>> I've done some searching and it sounds like this might be an issue with 32bit vs 64 bit builds, but I have no idea where to start. I'm on a macbook pro i7 (64 bit, right?). Would Pd have an effect here? Have I screwed something up?
>>> 
>>> Sorry to be so vague - using the py/python/mysql combination is pretty new to me.
>>> 
>>> cheers
>>> dafydd
>>> _______________________________________________
>>> Pd-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>>> 
>> 




More information about the Pd-list mailing list