[英]Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tu6ygqzj/mysql-python/
I am using python3 to install mysql-python package.我正在使用 python3 安装 mysql-python 包。 So, when I run所以,当我跑
pip install mysql-python, pip 安装 mysql-python,
it gives me error.它给了我错误。
Tried using尝试使用
pip install --upgrade setuptools pip install --upgrade 安装工具
It shows表明
Collecting mysql-python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-tu6ygqzj/mysql-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-tu6ygqzj/mysql-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
**ImportError: No module named 'ConfigParser'**
----------------------------------------
***Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-tu6ygqzj/mysql-python/***
Successfully installed with all files in it.成功安装,其中包含所有文件。
I guess you need to install the following:我想您需要安装以下内容:
pip install mysqlclient
In Python 3, ConfigParser
has been renamed to configparser
for PEP 8 compliance.在 Python 3 中, ConfigParser
已重命名为configparser
以符合 PEP 8。
mysqlclient
is a fork ofmysql-python
, with Python 3 support.mysqlclient
是mysql-python
一个分支,支持 Python 3。
Kindly make sure you have installed the following before installing mysqlclient
:在安装mysqlclient
之前,请确保您已安装以下内容:
sudo apt-get install python3-dev libmysqlclient-dev
For Lunix and Mac Machines, install the mysqlclient pre-requisites via:对于 Lunix 和 Mac 机器,通过以下方式安装 mysqlclient 先决条件:
Debian / Ubuntu - sudo apt-get install python-dev default-libmysqlclient-dev
Debian / Ubuntu - sudo apt-get install python-dev default-libmysqlclient-dev
Red Hat / CentOS - sudo yum install python-devel mysql-devel
Red Hat / CentOS - sudo yum install python-devel mysql-devel
macOS (Homebrew) - brew install mysql-client
macOS (Homebrew) - brew install mysql-client
我尝试在此之前执行此操作,因此在此之后它命令工作:
apt-get install libmysqlclient-dev
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.