您的位置:首页 > 其它

ModuleNotFoundError: No module named 'ConfigParser'

2017-12-01 08:15 4327 查看
问题:

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-c_y6ttgr/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-c_y6ttgr/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-c_y6ttgr/MySQL-python/


解决:

方法一:

修改six模块为

try:
import configparser
except:
from six.moves import configparser


方法二:

cp /usr/local/lib/python3.5/configparser.py /usr/local/lib/python3.5/ConfigParser.py
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: