installing MySQLdb module

R

rgarcia

I've installed the developer tools package, but when running "python
setup.py build" I get the following error:

python setup.py build
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.5/MySQLdb
running build_ext
building '_mysql' extension
gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -
Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -
DNDEBUG -g -O3 -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/
Applications/xampp/xamppfiles/include/mysql -I/Library/Frameworks/
Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/
temp.macosx-10.3-fat-2.5/_mysql.o -arch i386 -arch ppc
_mysql.c:35:23:_mysql.c:35:23: error: my_config.h: No such file or
directoryerror:
my_config.h: No such file or directory
....

I googled around and people say you need the "-dev" package of mysql
in order to have the C headers...where can you download this for mac
os?

Thanks,
Rafael

PS I am running XAMPP (http://www.keitr.com/tutorials/xampp) if that
changes anything
 
Z

zaphotbretzel

Hi Rafael,
I googled around and people say you need the "-dev" package of mysql
in order to have the C headers...where can you download this for mac
os?
PS I am running XAMPP (http://www.keitr.com/tutorials/xampp) if that
changes anything

Ok, here my solution to the problem (Mac OS X 10.4, Xampp and MySQLdb)

1) install Xcode from apple (for gcc, need free account for that,
http://developer.apple.com/)
2) get Mac binary tar from MySQL (http://dev.mysql.com/downloads/mysql/
5.0.html#macosx)
3) edit site.cfg (mysql_config = /Applications/xampp/xamppfiles/bin/
mysql_config)
4) copy include dir from MySQL package to /Applications/xampp/
xamppfiles/include/mysql

I bet downloading the same version from MySQL as installed from Xampp
could help.
And yes, you only need the include folder from the MySQL binary
package, do not install it.

Peace,
Zaphot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,130
Members
46,689
Latest member
liammiller

Latest Threads

Top