我正在努力 pip install
这个 MySQL-python
包裹,但我有一个 ImportError
.
Jans-MacBook-Pro:~ jan$ /Library/Frameworks/Python.framework/Versions/3.3/bin/pip-3.3 install MySQL-python
Downloading/unpacking MySQL-python
Running setup.py egg_info for package MySQL-python
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/var/folders/lf/myf7bjr57_jg7_5c4014bh640000gn/T/pip-build/MySQL-python/setup.py", line 14, in <module>
from setup_posix import get_config
File "./setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/var/folders/lf/myf7bjr57_jg7_5c4014bh640000gn/T/pip-build/MySQL-python/setup.py", line 14, in <module>
from setup_posix import get_config
File "./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 /var/folders/lf/myf7bjr57_jg7_5c4014bh640000gn/T/pip-build/MySQL-python
Storing complete log in /Users/jan/.pip/pip.log
Jans-MacBook-Pro:~ jan$
有什么想法吗?
18条答案
按热度按时间evrscar216#
python 2/3的兼容性
configparser
可以简单地通过six
图书馆pdkcd3nj17#
你可以用
mysqlclient
包作为mysql-python的替代品。这是一把叉子MySQL-python
添加了对python3的支持。我很幸运
在我的python3.4virtualenv之后
这显然是针对ubuntu/debian的,但我只想分享我的成功:)
dfuffjeb18#
我也有同样的问题。结果,我需要在centos上安装python3-devel。首先,您需要搜索与您的系统兼容的包。
然后,将软件包安装为:
然后,从pip安装mysqlclient