can't pip install mysql-python - python

I'm trying to get django/pip/mysql working and i can't seem to figure out how to install mysql-python. this is the error i receive when trying to install mysql-python
pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
Running setup.py egg_info for package mysql-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /tmp/tmp5jjdpf
Now working in /tmp/tmp5jjdpf/distribute-0.6.28
Building a Distribute egg in /home/brian/flaskapp/build/mysql-python
/home/brian/flaskapp/build/mysql-python/distribute-0.6.28-py2.7.egg
Installing collected packages: mysql-python
Running setup.py install for mysql-python
building '_mysql' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG
_mysql.c:29:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/brian/flaskapp/bin/python -c "import setuptools;__file__='/home/brian/flaskapp/build/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ur7r16-record/install-record.txt --single-version-externally-managed --install-headers /home/brian/flaskapp/include/site/python2.7:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g -DNDEBUG
_mysql.c:29:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /home/brian/flaskapp/bin/python -c "import setuptools;__file__='/home/brian/flaskapp/build/mysql-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Ur7r16-record/install-record.txt --single-version-externally-managed --install-headers /home/brian/flaskapp/include/site/python2.7 failed with error code 1 in /home/brian/flaskapp/build/mysql-python
Storing complete log in /home/brian/.pip/pip.log
Googling reveals i need to install python-dev but whenever i try to install with
sudo apt-get install python-dev
i get this error:
E: Package 'python-dev' has no installation candidate
I'm currently using linux mint 15 RC and i think that might be the issue...but i'm not sure.
I'm out of ideas:(

try downloading python-dev through software manager:
sudo apt-get install python-dev

ubuntu: sudo apt-get install libmysqlclient-dev

try
apt-get install python-mysqldb
Worked for me.

First create path as below by running into terminal
export PATH=/usr/local/mysql/bin:$PATH
After doing this run following command to terminal
sudo pip3 install flask-mysqldb

Related

Installing mysqlclient in Ubuntu returns error number 1

I am trying to install mysqlclient in Ubuntu, but the command returns error number 1.
I tried the command
sudo apt install default-libmysqlclient-dev
which worked. However
pip install mysqlclient
does not.
Can you please help me?
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2_cjSE/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-VZPWLf/mysqlclient/
Complete output (31 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/MySQLdb
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-3hk45v/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/include/mysql -I/usr/include/python2.7 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-2.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c:38:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-VZPWLf/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-2_cjSE/install-record.txt --single-version-externally-managed --compile Check the logs for full command output
.
Looks like you haven't properly installed the header files and static libraries for python-dev. Use your package manager to install them system-wide.
For apt (Ubuntu, Debian...):
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
This worked for me on Ubuntu + Python 3.7
sudo apt install python3.7 python3-dev libmysqlclient-dev libpython3.7-dev
pip install mysqlclient
Reference
Rather, try this solution. I was using Ubuntu 18.04 and found this solution to be useful for python version 3.7.5
Step 1. Install libpython3.7-dev via sudo
> sudo apt-get install libpython3.7-dev
Step 2: Install latest mysqlclient via pip
> python3 -m pip install mysqlclient==1.4.6

ubuntu 16.04 python 3.7.4 pip mysqlclient error [duplicate]

This question already has answers here:
setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 [closed]
(38 answers)
Closed 3 years ago.
I want to install mysqlclient in my ubuntu server.
python version is 3.7.4.
But I can't install this package.(It installed well in 3.6.5)
This is Error message.
(tmp) ubuntu#orcinus:~$ pip install mysqlclient
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/ubuntu/tmp/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4oxpmvqx/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4oxpmvqx/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1lcdb63b --python-tag cp37
cwd: /tmp/pip-install-4oxpmvqx/mysqlclient/
Complete output (29 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb
creating build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/MySQLdb
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/include/mysql -I/usr/include/python3.7m -I/home/ubuntu/tmp/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c:38:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: /home/ubuntu/tmp/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4oxpmvqx/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4oxpmvqx/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1f31t3fb/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/tmp/include/site/python3.7/mysqlclient
cwd: /tmp/pip-install-4oxpmvqx/mysqlclient/
Complete output (29 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb
creating build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/MySQLdb
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,4,'final',0) -D__version__=1.4.4 -I/usr/include/mysql -I/usr/include/python3.7m -I/home/ubuntu/tmp/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o
MySQLdb/_mysql.c:38:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/ubuntu/tmp/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4oxpmvqx/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4oxpmvqx/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1f31t3fb/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/tmp/include/site/python3.7/mysqlclient Check the logs for full command output.
What should I do?
I must use mysqlclient not pymysql.
Stackoverflow says add some more details.. but I don't know what should I add more.
Thank you.
You need to install python version specific python-dev. In your case you need to install python-dev for python3.7
sudo apt-get install python3.7-dev
source
install this:
sudo apt-get install python3-dev

How to fix "ld: library not found for -lxxx " on my Mac when "pip3 install mysqlclient"?

I was going to use Django to develop my personal blog. I encountered this problem when configuring the environment:
~ » pip3 install mysqlclient hwangziqi#huangziqideMBP
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup_posix.py", line 53, in get_config
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup_posix.py", line 53, in <listcomp>
libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')]
File "/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-bbsgdat8/mysqlclient/setup_posix.py", line 12, in dequote
raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?")
Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?
So, i tried https://bugs.mysql.com/bug.php?id=86971 .
$ mysql_config
Usage: /usr/local/bin/mysql_config [OPTIONS]
Options:
--cflags [-I/usr/local/Cellar/mysql-connector-c/6.1.10/include ]
--cxxflags [-I/usr/local/Cellar/mysql-connector-c/6.1.10/include ]
--include [-I/usr/local/Cellar/mysql-connector-c/6.1.10/include]
--libs [-L/usr/local/Cellar/mysql-connector-c/6.1.10/lib -l ]
--libs_r [-L/usr/local/Cellar/mysql-connector-c/6.1.10/lib -l ]
--plugindir [/usr/local/Cellar/mysql-connector-c/6.1.10/lib/plugin]
--socket [/tmp/mysql.sock]
--port [0]
--version [6.1.10]
--variable=VAR VAR is one of:
pkgincludedir [/usr/local/Cellar/mysql-connector-c/6.1.10/include]
pkglibdir [/usr/local/Cellar/mysql-connector-c/6.1.10/lib]
plugindir [/usr/local/Cellar/mysql-connector-c/6.1.10/lib/plugin]
`--libs` and `--libs_r` should have ` -lmysqlclient -lssl -lcrypto`, but it only have `-l`.
and now:
» pip3 install mysqlclient hwangziqi#huangziqideMBP
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-85s5jozc/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-record-x9p5inkf/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/compat.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb
creating build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.9-x86_64-3.7/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/MySQLdb
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Dversion_info=(1,4,2,'post',1) -D__version__=1.4.2.post1 -I/usr/local/Cellar/mysql-connector-c/6.1.11/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.o -L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.7/MySQLdb/_mysql.cpython-37m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-85s5jozc/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-record-x9p5inkf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/09/s28t32055hl9z2mcffwjhq040000gn/T/pip-install-85s5jozc/mysqlclient/
i tried to reinstall openssl and mysql-connector-c by brew, but it was useless. My English is poor, I hope you can understand it. Thx so mush.

Zipline in Ubuntu - Install error [duplicate]

This question already has answers here:
setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 [closed]
(38 answers)
Closed 4 years ago.
So i am trying to install zipline, and i am getting an error i don't know how to handle. Firstly i run the following commands:
virtualenv -p python3.5 zipline
source /zipline/bin/activate
Then as the guide suggests
sudo apt-get install libatlas-base-dev python-dev gfortran pkg-config libfreetype6-dev
this installs with out a hitch, then
pip install numpy
pip install cython
pip install -U setuptools
then lastly
pip install zipline
This gives med the following (long) error message, even though i looks like it is the same error multiple times.
zipline/assets/_assets.c:4:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for zipline
Running setup.py clean for zipline
Running setup.py bdist_wheel for cyordereddict ... error
Complete output from command /home/bluehelmet/virtualenv/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6nfwm6vn/cyordereddict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-dsh6t2sb --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/cyordereddict
copying python3/cyordereddict/_version.py -> build/lib.linux-x86_64-3.5/cyordereddict
copying python3/cyordereddict/__init__.py -> build/lib.linux-x86_64-3.5/cyordereddict
creating build/lib.linux-x86_64-3.5/cyordereddict/benchmark
copying python3/cyordereddict/benchmark/magic_timeit.py -> build/lib.linux-x86_64-3.5/cyordereddict/benchmark
copying python3/cyordereddict/benchmark/benchmark.py -> build/lib.linux-x86_64-3.5/cyordereddict/benchmark
copying python3/cyordereddict/benchmark/__init__.py -> build/lib.linux-x86_64-3.5/cyordereddict/benchmark
creating build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/test_ordereddict.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/test_cyordereddict.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/_mapping_tests.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/__init__.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
running build_ext
building 'cyordereddict._cyordereddict' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/python3
creating build/temp.linux-x86_64-3.5/python3/cyordereddict
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-FZMKe6/python3.5-3.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -I/home/bluehelmet/virtualenv/zipline/include/python3.5m -c python3/cyordereddict/_cyordereddict.c -o build/temp.linux-x86_64-3.5/python3/cyordereddict/_cyordereddict.o
python3/cyordereddict/_cyordereddict.c:12:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for cyordereddict
Running setup.py clean for cyordereddict
Running setup.py bdist_wheel for bottleneck ... error
Complete output from command /home/bluehelmet/virtualenv/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6nfwm6vn/bottleneck/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-_x73ag17 --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/bottleneck
copying bottleneck/version.py -> build/lib.linux-x86_64-3.5/bottleneck
copying bottleneck/__init__.py -> build/lib.linux-x86_64-3.5/bottleneck
creating build/lib.linux-x86_64-3.5/bottleneck/slow
copying bottleneck/slow/nonreduce.py -> build/lib.linux-x86_64-3.5/bottleneck/slow
copying bottleneck/slow/reduce.py -> build/lib.linux-x86_64-3.5/bottleneck/slow
copying bottleneck/slow/move.py -> build/lib.linux-x86_64-3.5/bottleneck/slow
copying bottleneck/slow/__init__.py -> build/lib.linux-x86_64-3.5/bottleneck/slow
copying bottleneck/slow/nonreduce_axis.py -> build/lib.linux-x86_64-3.5/bottleneck/slow
creating build/lib.linux-x86_64-3.5/bottleneck/src
copying bottleneck/src/template.py -> build/lib.linux-x86_64-3.5/bottleneck/src
copying bottleneck/src/__init__.py -> build/lib.linux-x86_64-3.5/bottleneck/src
creating build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/nonreduce_axis_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/scalar_input_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/reduce_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/list_input_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/nonreduce_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/move_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/__init__.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/input_modifcation_test.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
copying bottleneck/tests/util.py -> build/lib.linux-x86_64-3.5/bottleneck/tests
creating build/lib.linux-x86_64-3.5/bottleneck/benchmark
copying bottleneck/benchmark/autotimeit.py -> build/lib.linux-x86_64-3.5/bottleneck/benchmark
copying bottleneck/benchmark/bench_detailed.py -> build/lib.linux-x86_64-3.5/bottleneck/benchmark
copying bottleneck/benchmark/bench.py -> build/lib.linux-x86_64-3.5/bottleneck/benchmark
copying bottleneck/benchmark/__init__.py -> build/lib.linux-x86_64-3.5/bottleneck/benchmark
copying bottleneck/LICENSE -> build/lib.linux-x86_64-3.5/bottleneck
running build_ext
building 'bottleneck.reduce' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/bottleneck
creating build/temp.linux-x86_64-3.5/bottleneck/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-FZMKe6/python3.5-3.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/bluehelmet/virtualenv/zipline/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/bluehelmet/virtualenv/zipline/include/python3.5m -c bottleneck/src/reduce.c -o build/temp.linux-x86_64-3.5/bottleneck/src/reduce.o -O2
In file included from bottleneck/src/reduce.c:1:0:
bottleneck/src/bottleneck.h:4:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for bottleneck
Running setup.py clean for bottleneck
Running setup.py bdist_wheel for bcolz ... error
Complete output from command /home/bluehelmet/virtualenv/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6nfwm6vn/bcolz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-uga7q655 --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/bcolz
copying bcolz/utils.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/ctable.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/py2help.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/version.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/toplevel.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/attrs.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/chunked_eval.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/py2help_tests.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/__init__.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/arrayprint.py -> build/lib.linux-x86_64-3.5/bcolz
copying bcolz/defaults.py -> build/lib.linux-x86_64-3.5/bcolz
creating build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/common.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/test_attrs.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/test_ndcarray.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/test_queries.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/test_carray_objects.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/__init__.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/test_carray.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/test_ctable.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/tests/all.py -> build/lib.linux-x86_64-3.5/bcolz/tests
copying bcolz/carray_ext.pxd -> build/lib.linux-x86_64-3.5/bcolz
running build_ext
skipping 'bcolz/carray_ext.c' Cython extension (up-to-date)
building 'bcolz.carray_ext' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/bcolz
creating build/temp.linux-x86_64-3.5/c-blosc
creating build/temp.linux-x86_64-3.5/c-blosc/blosc
creating build/temp.linux-x86_64-3.5/c-blosc/internal-complibs
creating build/temp.linux-x86_64-3.5/c-blosc/internal-complibs/lz4-r119
creating build/temp.linux-x86_64-3.5/c-blosc/internal-complibs/snappy-1.1.1
creating build/temp.linux-x86_64-3.5/c-blosc/internal-complibs/zlib-1.2.8
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-FZMKe6/python3.5-3.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_LZ4=1 -DHAVE_SNAPPY=1 -DHAVE_ZLIB=1 -Ibcolz -Ic-blosc/blosc -Ic-blosc/internal-complibs/zlib-1.2.8 -Ic-blosc/internal-complibs/snappy-1.1.1 -Ic-blosc/internal-complibs/lz4-r119 -I/home/bluehelmet/virtualenv/zipline/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -I/home/bluehelmet/virtualenv/zipline/include/python3.5m -c bcolz/carray_ext.c -o build/temp.linux-x86_64-3.5/bcolz/carray_ext.o
bcolz/carray_ext.c:4:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for bcolz
Running setup.py clean for bcolz
Running setup.py bdist_wheel for lru-dict ... error
Complete output from command /home/bluehelmet/virtualenv/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6nfwm6vn/lru-dict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-5ckeqmpz --python-tag cp35:
running bdist_wheel
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-FZMKe6/python3.5-3.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -I/home/bluehelmet/virtualenv/zipline/include/python3.5m -c lru.c -o build/temp.linux-x86_64-3.5/lru.o
lru.c:1:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for lru-dict
Running setup.py clean for lru-dict
Failed to build zipline cyordereddict bottleneck bcolz lru-dict
Installing collected packages: cyordereddict, bottleneck, contextlib2, decorator, networkx, numexpr, bcolz, click, toolz, multipledispatch, MarkupSafe, Mako, sqlalchemy, python-editor, alembic, sortedcontainers, intervaltree, lru-dict, empyrical, tables, zipline
Running setup.py install for cyordereddict ... error
Complete output from command /home/bluehelmet/virtualenv/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6nfwm6vn/cyordereddict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-55p6137n/install-record.txt --single-version-externally-managed --compile --install-headers /home/bluehelmet/virtualenv/zipline/include/site/python3.5/cyordereddict:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/cyordereddict
copying python3/cyordereddict/_version.py -> build/lib.linux-x86_64-3.5/cyordereddict
copying python3/cyordereddict/__init__.py -> build/lib.linux-x86_64-3.5/cyordereddict
creating build/lib.linux-x86_64-3.5/cyordereddict/benchmark
copying python3/cyordereddict/benchmark/magic_timeit.py -> build/lib.linux-x86_64-3.5/cyordereddict/benchmark
copying python3/cyordereddict/benchmark/benchmark.py -> build/lib.linux-x86_64-3.5/cyordereddict/benchmark
copying python3/cyordereddict/benchmark/__init__.py -> build/lib.linux-x86_64-3.5/cyordereddict/benchmark
creating build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/test_ordereddict.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/test_cyordereddict.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/_mapping_tests.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
copying python3/cyordereddict/test/__init__.py -> build/lib.linux-x86_64-3.5/cyordereddict/test
running build_ext
building 'cyordereddict._cyordereddict' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/python3
creating build/temp.linux-x86_64-3.5/python3/cyordereddict
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-FZMKe6/python3.5-3.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -I/home/bluehelmet/virtualenv/zipline/include/python3.5m -c python3/cyordereddict/_cyordereddict.c -o build/temp.linux-x86_64-3.5/python3/cyordereddict/_cyordereddict.o
python3/cyordereddict/_cyordereddict.c:12:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/bluehelmet/virtualenv/zipline/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-6nfwm6vn/cyordereddict/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-55p6137n/install-record.txt --single-version-externally-managed --compile --install-headers /home/bluehelmet/virtualenv/zipline/include/site/python3.5/cyordereddict" failed with error code 1 in /tmp/pip-install-6nfwm6vn/cyordereddict/
It looks like it have trouble building wheels. After googleing a bit, i couldn't find any solutions. What's your input?
So i found thanks to the comment that i needed to
sudo apt install python3.5-dev
This question is resolved.

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

Like many people, I am having issues getting mysql and python to work together. My specs are:
OSX10.9.2
Anaconda 1.9.1 with python 2.7.2, although 2.5 and 2.6 appear to be included
MySQL 5.6.16
I have written a python script where I try to import MySQLdb, or PyMySQL then MySQLdb, neither works.
I read many of the threads on stack overflow, and as a result I eventually tried
$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ pip install mysql-python
The results are below. A fatal error was issued, as can be seen at the bottom of the 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 for package mysql-python
Installing collected packages: mysql-python
Running setup.py install for 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 from _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 with exit status 1
Complete output from 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 from _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 with 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 with error code 1 in /private/var/folders/lx/h7jq_qx92_j0n7plsjmr6wl40000gp/T/pip_build_vincent/mysql-python
Storing debug log for failure in /Users/vincentlaufer/.pip/pip.log
I would like to thank everyone for the many answers provided that got me this far already, but also to ask if anyone knows how to solve this issue. Thank you!!
Inclusion of the line:
$ xcode-select --install
solves this problem, as per: GCC fatal error: stdio.h: No such file or directory

Categories