Fatal error: #include <stdio.h> generated after "pip install mysql-python" command -


like many people, having issues getting mysql , python work together. specs are:

osx10.9.2 anaconda 1.9.1 python 2.7.2, although 2.5 , 2.6 appear included mysql 5.6.16

i have written python script try import mysqldb, or pymysql mysqldb, neither works.

i read many of threads on stack overflow, , result tried

$ export cflags=-qunused-arguments $ export cppflags=-qunused-arguments $ pip install mysql-python 

the results below. fatal error issued, can seen @ bottom of output.

downloading/unpacking mysql-python downloading mysql-python-1.2.5.zip (108kb): 108kb downloaded running setup.py (path:/private/var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/t/pip_build_vincent/mysql-python/setup.py) egg_info package mysql-python

installing collected packages: mysql-python running setup.py install mysql-python building '_mysql' extension /usr/bin/clang -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -qunused-arguments -qunused-arguments -dversion_info=(1,2,5,'final',1) -d_version_=1.2.5 -i/usr/local/mysql/include -i/users/vincentlaufer/anaconda/include/python2.7 -c _mysql.c -o build/temp.macosx-10.5-x86_64-2.7/_mysql.o -os -g -fno-strict-aliasing -arch x86_64 in file included _mysql.c:29: /users/vincent/anaconda/include/python2.7/python.h:33:10: fatal error: 'stdio.h' file not found #include ^ 1 error generated. error: command '/usr/bin/clang' failed exit status 1 complete output command /users/vincentlaufer/anaconda/bin/python -c "import setuptools, tokenize;file='/private/var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/t/pip_build_vincent/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/t/pip-6aqgyj-record/install-record.txt --single-version-externally-managed --compile: running install

running build

running build_py

creating build

creating build/lib.macosx-10.5-x86_64-2.7

copying _mysql_exceptions.py -> build/lib.macosx-10.5-x86_64-2.7

creating build/lib.macosx-10.5-x86_64-2.7/mysqldb

copying mysqldb/init.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb

copying mysqldb/converters.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb

copying mysqldb/connections.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb

copying mysqldb/cursors.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb

copying mysqldb/release.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb

copying mysqldb/times.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb

creating build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/init.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/cr.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/field_type.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/er.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/flag.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/refresh.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

copying mysqldb/constants/client.py -> build/lib.macosx-10.5-x86_64-2.7/mysqldb/constants

running build_ext

building '_mysql' extension

creating build/temp.macosx-10.5-x86_64-2.7

/usr/bin/clang -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -qunused-arguments -qunused-arguments -dversion_info=(1,2,5,'final',1) -d_version_=1.2.5 -i/usr/local/mysql/include -i/users/vincent/anaconda/include/python2.7 -c _mysql.c -o build/temp.macosx-10.5-x86_64-2.7/_mysql.o -os -g -fno-strict-aliasing -arch x86_64

in file included _mysql.c:29: /users/vincent/anaconda/include/python2.7/python.h:33:10: fatal error: 'stdio.h' file not found

include stdio.h

     ^ 

1 error generated.

error: command '/usr/bin/clang' failed exit status 1


cleaning up... command /users/vincent/anaconda/bin/python -c "import setuptools, tokenize;file='/private/var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/t/pip_build_vincent/mysql-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/t/pip-6aqgyj-record/install-record.txt --single-version-externally-managed --compile failed error code 1 in /private/var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/t/pip_build_vincent/mysql-python storing debug log failure in /users/vincentlaufer/.pip/pip.log

i thank many answers provided got me far already, ask if knows how solve issue. thank you!!

inclusion of line:

$ xcode-select --install  

solves problem, per: gcc fatal error: stdio.h: no such file or directory


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -