Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
can';t pip安装mysql-python_Python_Django_Pip - Fatal编程技术网

can';t pip安装mysql-python

can';t pip安装mysql-python,python,django,pip,Python,Django,Pip,我试图让django/pip/mysql正常工作,但我似乎不知道如何安装mysql-python。这是我在尝试安装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-pyth

我试图让django/pip/mysql正常工作,但我似乎不知道如何安装mysql-python。这是我在尝试安装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 我得到这个错误:

E: Package 'python-dev' has no installation candidate E:包“python-dev”没有安装候选程序 我目前正在使用LinuxMint15RC,我认为这可能是问题所在……但我不确定。
我没有主意了:(

尝试通过软件管理器下载python开发:

sudo apt-get install python-dev
试一试


为我工作。

ubuntu:
sudo apt get install libmysqlclient dev
首先通过运行终端创建如下路径

export PATH=/usr/local/mysql/bin:$PATH

执行此操作后,运行以下命令到终端


sudo pip3 install flask mysqldb

我在mint论坛上发现了这个…
sudo apt get install python all dev
。我不知道mint中的东西的名称,所以我不能保证任何成功。$mysql\u config程序“mysql\u config”当前未安装。您可以通过以下命令安装它:sudo apt get安装libmysqlclient devI我想指出的是,运行pip install mysql python完全搞砸了我的项目。最后,我决定用postresql数据库更改我的mysql数据库。请看这里,如果您提供解决方案而不是解决方案,这将非常有用。apt install python3 dev
sudo apt-get install python-dev
apt-get install python-mysqldb