我正在尝试让 django/pip/mysql 正常工作,但我似乎无法弄清楚如何安装 mysql-python。这是我在尝试安装 mysql-python 时收到的错误
点安装 mysql-python
下载/解压 mysql-python
下载 MySQL-python-1.2.4.zip (113kB):已下载 113kB
为包 mysql-python 运行 setup.py egg_info
下载 http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
在 /tmp/tmp5jjdpf 中提取
现在在 /tmp/tmp5jjdpf/distribute-0.6.28 工作
在 /home/brian/flaskapp/build/mysql-python 中构建一个分布式鸡蛋
/home/brian/flaskapp/build/mysql-python/distribute-0.6.28-py2.7.egg
安装收集的包:mysql-python
为 mysql-python 运行 setup.py install
构建“_mysql”扩展
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-别名 -g -DNDEBUG
_mysql.c:29:20:致命错误:Python.h:没有这样的文件或目录
编译终止。
错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1
命令的完整输出 /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:
运行安装
运行构建
运行 build_py
创建构建
创建 build/lib.linux-x86_64-2.7
复制 _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
创建 build/lib.linux-x86_64-2.7/MySQLdb
复制 MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
复制 MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
复制 MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
复制 MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
复制 MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
复制 MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
创建 build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
复制 MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
运行 build_ext
构建“_mysql”扩展
创建 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-别名 -g -DNDEBUG
_mysql.c:29:20:致命错误:Python.h:没有这样的文件或目录
编译终止。
错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1
--------------------------------------
打扫干净...
命令 /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-托管 --install-headers /home/brian/flaskapp/include/site/python2.7 失败,错误代码 1 在 /home/brian/flaskapp/build/mysql-python
在 /home/brian/.pip/pip.log 中存储完整的日志
谷歌搜索显示我需要安装 python-dev 但每当我尝试安装时
sudo apt-get install python-dev
我收到此错误:
E: 包 'python-dev' 没有安装候选
我目前正在使用 linux mint 15 RC,我认为这可能是问题......但我不确定。我没有想法:(