不能 pip install mysql-python [英] can't pip install mysql-python
本文介绍了不能 pip install mysql-python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试让 django/pip/mysql 工作,但我似乎无法弄清楚如何安装 mysql-python.这是我在尝试安装 mysql-python 时收到的错误
<前>pip 安装 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(' ', ' '), __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.7x86_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(' ', ' '), __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,我认为这可能是问题...但我不确定.我没有想法:(
解决方案
尝试通过软件管理器下载python-dev:
sudo apt-get install python-dev
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(' ', ' '), __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(' ', ' '), __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
这篇关于不能 pip install mysql-python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文