Python MySQL error on Mac OS X 10.6 i386

While trying to install MySQL python bindings, MySQLdb, I followed the build and install instructions on my MacBook running Mac OS X 10.6 i386 and after entering the following line in the terminal:

user-152-3-158-79:MySQL-python-1.2.3c1 jianweigan$ sudo python setup.py build

      

I am getting the following errors:

running build
running build_py
creating build/lib.macosx-10.3-i386-2.6
copying _mysql_exceptions.py -> build/lib.macosx-10.3-i386-2.6
creating build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
creating build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.3-i386-2.6
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation

      

It looks like the setup.py build script is recognizing my OS as Mac OS X 10.3 instead of 10.6, so it tries to find an older version of XCode that I don't have.

Does anyone know how to get around this issue? Perhaps manually configuring a script to recognize my os as 10.6?

+2


source to share


3 answers


You seem to have installed and are using python.org python2.6. Since this installer is designed to work on a range of systems, in order to build extensions with this python on 10.6, you need to install the optional 10.4 SDK, which is part of the Xcode package on the DVD to install DVDs or the DVD to run Snow Leopard; 10.4 SDK is not installed by default. This is what the message is trying to tell you.



+9


source


Installing the latest Python from python.org fixed this issue for me.



+1


source


Well the error is pretty clear, do you have xcode installed? http://developer.apple.com/tools/Xcode/

You can look at a more detailed solution to this question at http://blog.some-abstract-type.com/2009/09/mysql-python-and-mac-os-x-106-snow.html which includes downloading the latest xcode ... Hope it helps.

-1


source







All Articles