Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/58.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.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
Python 2.7+;Django+;MySQL python错误_Mysql_Django_Python 2.7_Pip_Mysql Python - Fatal编程技术网

Python 2.7+;Django+;MySQL python错误

Python 2.7+;Django+;MySQL python错误,mysql,django,python-2.7,pip,mysql-python,Mysql,Django,Python 2.7,Pip,Mysql Python,我在Ubuntu上安装了Python 2.7、Django 1.5.5和MySQL 5.5。然后我尝试为python安装SQL驱动程序: sudo pip install MySQL-python 结果是 Downloading/unpacking MySQL-python Cannot fetch index base URL https://pypi.python.org/simple/ Could not find any downloads that satisfy the requi

我在Ubuntu上安装了Python 2.7、Django 1.5.5和MySQL 5.5。然后我尝试为python安装SQL驱动程序:

sudo pip install MySQL-python
结果是

Downloading/unpacking MySQL-python
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement MySQL-python
Cleaning up...
No distributions at all found for MySQL-python
Storing debug log for failure in .pip/pip.log
有什么问题吗

我试过: sudoeasy_安装MySQL-python

结果是:

> Searching for MySQL-python Reading
> http://pypi.python.org/simple/MySQL-python/ Download error on
> http://pypi.python.org/simple/MySQL-python/: [Errno -3] Temporary     
> failure in name resolution -- Some packages may not be found! Reading
> http://pypi.python.org/simple/MySQL-python/ Download error on
> http://pypi.python.org/simple/MySQL-python/: [Errno -3] Temporary
> failure in name resolution -- Some packages may not be found! Couldn't
> find index page for 'MySQL-python' (maybe misspelled?) Scanning index
> of all packages (this may take a while) Reading
> http://pypi.python.org/simple/ Download error on
> http://pypi.python.org/simple/: [Errno -3] Temporary failure in name
> resolution -- Some packages may not be found! No local packages or
> download links found for MySQL-python error: Could not find suitable
> distribution for Requirement.parse('MySQL-python')

正确的命令是:

sudo ap-get install python-mysqldb

您是否尝试过“轻松安装MySQL python”?(如果没有安装python dev,则需要执行“apt get install python dev”操作)看起来像是包名解析中的问题,无论我采用何种方式执行该操作。
sudo apt get install python mysqldb
仅在清理后才起作用。首先,我将.deb包从存储库下载到本地磁盘(不是默认的存储库),但安装失败。后来我制作了
sudo apt get remove./python-mysqldb_1.2.3-1build1_i386.deb
。这项清理工作不知为何奏效。终于
sudo-apt-get-install-python-mysqldb
成功了。@ph7:那么您现在应该能够
pip-install-MySQL-python