On Feb 23, 2011, at 9:13 PM, Edo wrote: > Hello All, > > I'm trying TG and I have a problem with Mac OS X, Python, MySQL, and > virtual environments: > > When I try to setup my project using mysql, I get the following error: > > __ > ImportError: dlopen(/Users/user/.python-eggs/MySQL_python-1.2.3-py2.6- > macosx-10.6-universal.egg-tmp/_mysql.so, 2): Library not loaded: > libmysqlclient.16.dylib > Referenced from: /Users/user/.python-eggs/MySQL_python-1.2.3-py2.6- > macosx-10.6-universal.egg-tmp/_mysql.so > Reason: image not found > (tg2env)Ratbert:TestProject user$ > > The referenced file is in: > > /usr/local/mysql-5.5.9-osx10.6-x86_64/lib/libmysqlclient.16.dylib > > I tried: > > sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql > > but nothing changed. > > I know it's not a TG problem, but any hint is very welcomed.
You have a architecture-mismatch here. Your mysql library seems to be a fat binary. You can verify using the file-command like this: (zms_test)tequila:zms-test deets$ file /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.4-x86_64.egg/pygame/_arraysurfarray.so /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.4-x86_64.egg/pygame/_arraysurfarray.so: Mach-O 64-bit bundle x86_64 That's just another object file inside an, you need to use _mysql.so and libmysqlclient.16.dylib. You can use the lipo-tool to remove unneeded architectures from binary files, but be aware that this of course might break other dependencies that still are fat - you need to be transitive here. Diez -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

