Menu

Mac OS X install: not found for -lmysql

Help
2011-04-11
2012-09-19
  • Bob Swerdlow

    Bob Swerdlow - 2011-04-11

    On Mac OS X 10.6, with python 2.7, I get an error when trying to install:

    ~/Downloads/MySQL-python-1.2.3 $python setup.py build

    running build

    running build_py

    copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb

    running build_ext

    building '_mysql' extension

    /usr/bin/gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g
    -O3 -Dversion_info=(1,2,3,'final',0) -Dversion=1.2.3
    -I/usr/local/mysql/include
    -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
    _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -arch i386 -fno-
    common

    /var/folders/DX/DXNjtYfhGGWFsBwqkxUEf++++TI/-Tmp-//ccl5C6Gp.s:unknown:FATAL:ca
    n't create output file: build/temp.macosx-10.6-intel-2.7/_mysql.o

    error: command '/usr/bin/gcc-4.0' failed with exit status 1

    ~/Downloads/MySQL-python-1.2.3 $

    I can't find any help on how to fix this. Thanks for responding!

     
  • Anonymous

    Anonymous - 2011-05-09

    I had the same problem, and could not find a solution either.

    Mac OS 10.6 (clean install) has no support any more for gcc-4.0. However, it
    has gcc-4.2 installed. A dirty solution to this problem is:

    sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc-4.0
    

    After that, install MySQL-python 1.2.3 by

    python setup.py build
    
    python setup.py install
    

    Now, to clean our dirt we have to delete the symbolic link

    sudo rm /usr/bin/gcc-4.0
    

    HTH

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.