简体   繁体   中英

Installing mysql on mac snow leopard Mac OS X 10.6.8 error

I'm a newbie to Django and I want to run it not with SQLite but with my current MySQL database set up through PHP. However, I am coding mainly on a Mac (the bane of my developer existence) and I have run into a problem with running:

python setup.py build

from my MySQL-python-1.2.4b4 folder and it's giving me the following error. I have tried Googling for the solution but most results show an error with XCode4 for Mac OS Lion or Mountain Lion and I'm running Snow Leopard. The results I found for Snow Leopard doesn't work either.

running develop

running egg_info

writing MySQL_python.egg-info/PKG-INFO

writing top-level names to MySQL_python.egg-info/top_level.txt

writing dependency_links to MySQL_python.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found

reading manifest file 'MySQL_python.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'MySQL_python.egg-info/SOURCES.txt'

running build_ext

building '_mysql' extension

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.6-universal-2.6/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL

unable to execute gcc-4.2: No such file or directory

error: command 'gcc-4.2' failed with exit status 1

Since you mention that xcodebuild is not found, the most likely explanation is that you have not yet installed a version of Xcode which includes various build tools, like the gcc C compiler needed to build the C extension module included in MySQL-python . Since you are running on OS X 10.6, Snow Leopard, the most recent version of Xcode for 10.6 that includes gcc-4.2 is Xcode 3.2.6 which you can download without cost from the Apple Developer site after free registration. See, for example, the directions here . Unfortunately, the download is very large. (More recent releases of Xcode for more recent OS X releases are packaged in smaller pieces but they are not supported on 10.6.) The good news is: you'll only have to do it once since Xcode for 10.6 is not likely to ever be updated again!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM