#333 Build Error on OSX: unable to execute /: Permission denied


Mac OSX: 10.8.4
Python: 2.7.5
MySQL: 5.6.12-osx10.7-x86_64
Xcode: 4.6.3
MySQL-python: 1.2.4

Got this error when doing pip install mysql-python and got the same error when trying to install it from source (below):

$ python setup.py install
running install
running bdist_egg
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
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
/ A p p l i c a t i o n s / X c o d e . a p p / C o n t e n t s / D e v e l o p e r / T o o l c h a i n s / X c o d e D e f a u l t . x c t o o l c h a i n / u s r / b i n / c l a n g   - f n o - s t r i c t - a l i a s i n g   - f n o - c o m m o n   - d y n a m i c     - a r c h   i 3 8 6   - a r c h   x 8 6 _ 6 4   - g   - O 2   - D N D E B U G   - g   - O 3   -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -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 -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
unable to execute /: Permission denied
error: command '/' failed with exit status 1


  • Andy Dustman

    Andy Dustman - 2013-06-28

    Something derpy is going on with your setuptools or distribute or whatever.

    Now you say you're running Mac OSX 10.8.4 (Mountain Lion), but your output says your running 10.6 (Snow Leopard). Did you recently upgrade, and if so, did you upgrade Xcode as well? Is this Python 2.7.5 the system python, or is it from some other source?

    Can't duplicate on Snow Leopard with Python 2.7.3 from MacPorts.

  • yscumc

    yscumc - 2013-06-28

    Here are the installed packages:

    $ pip list
    distribute (0.6.34)
    Django (1.5.1)
    pytz (2013b)
    wsgiref (0.1.2)

    I formatted and reinstalled OSX 10.8.3 three days ago and upgraded to 10.8.4 shortly after.

    Installing other packages worked fine, but then again the other packages did not require a native compiler. I've just tried downgrading to Xcode 4.4.1 and still got the same problem...

  • yscumc

    yscumc - 2013-06-28

    Hi Andy,

    Thanks for pointing out MacPorts, I found out what the problem was from there. When trying to install MacPorts, I had to install the Xcode command line tools. After installing it, I decided to try it building mysql-python again and it worked!

    The error message wasn't so obvious, but it seems to be caused by having Xcode, but not the Xcode command line tools.

    $ pip install mysql-python
    Downloading/unpacking mysql-python
      Running setup.py egg_info for package mysql-python
    Installing collected packages: mysql-python
      Running setup.py install for mysql-python
        building '_mysql' extension
        /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -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 -Wno-null-conversion -Os -g -fno-strict-aliasing -arch x86_64
        In file included from _mysql.c:44:
        /usr/local/mysql/include/my_config.h:347:11: warning: 'SIZEOF_SIZE_T' macro redefined
          #define SIZEOF_SIZE_T  SIZEOF_LONG
        /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:43:17: note: previous definition is here
        #        define SIZEOF_SIZE_T           8
        In file included from _mysql.c:44:
        /usr/local/mysql/include/my_config.h:441:9: warning: 'HAVE_WCSCOLL' macro redefined
        #define HAVE_WCSCOLL
        /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:902:9: note: previous definition is here
        #define HAVE_WCSCOLL 1
        _mysql.c:1567:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (how < 0 || how >= sizeof(row_converters)) {
                    ~~~ ^ ~
        3 warnings generated.
        /usr/bin/clang -bundle -undefined dynamic_lookup -g build/temp.macosx-10.6-intel-2.7/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -o build/lib.macosx-10.6-intel-2.7/_mysql.so -arch x86_64
    Successfully installed mysql-python
    Cleaning up...
    $ pip list
    distribute (0.6.34)
    Django (1.5.1)
    MySQL-python (1.2.4)
    pytz (2013b)
    wsgiref (0.1.2)

    Thanks a bunch.

  • yscumc

    yscumc - 2013-06-28

    By the way, I didn't see this documented anywhere, though hopefully I didn't just miss it.

    I'm fairly new to Mac and didn't know Xcode command line tools were required (though I did find it strange that gcc, clang, etc. wasn't in the path but a compiler was detected after Xcode was installed). Even though this is probably a noobish problem, please consider adding this to the documentation as it may help others.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks