Re: Problems in building 1.2.2 on Mac OS 10.5
Posted by:
Michal Kox
Date: October 27, 2007 04:06PM
What i did:
1) I removed lines listed below from _mysql.c file
#ifndef uint
#define uint unsigned int
#endif
2) I ran command
python setup.py build
Yes,I received this warning:
ld: warning in build/temp.macosx-10.5-i386-2.5/_mysql.o, file is not of required architecture
ld: warning in /usr/local/mysql/lib/libmysqlclient_r.dylib, file is not of required architecture
3) I ran command
python setup.py install
When I tried to run my python script, an error occured:
import MySQLdb
File "build/bdist.macosx-10.5-i386/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.5-i386/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/kox/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
Referenced from: /Users/kox/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg-tmp/_mysql.so
Reason: image not found
So I did this:
sudo mkdir /usr/local/mysql/lib/mysql
sudo cp /usr/local/mysql/lib/libmysqlclient_r.15.dylib /usr/local/mysql/lib/mysql/libmysqlclient_r.15.dylib
And it works now :)
Edited 1 time(s). Last edit at 10/27/2007 04:08PM by Michal Kox.