python3.x下pip安装 MySQL-python报错No module named 'ConfigParser'

cygwin下virtual-env的python3.6下安装 MySQL-python报错,错误消息如后,提示找不到ConfigParser模块,而事实上该模块在python3.x后改名了。那就照旧名做个包,引用进去。

文件 /path-to-you-python/site-packages/ConfigParser.py

内容如下(事实上只要第二行就行),再运行正常了。(当然mysql-python的其他依赖包之前已经安装过。)

"""compatible configparser"""
from configparser import *
$ pip install MySQL-python
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting MySQL-python
  Downloading https://mirrors.ustc.edu.cn/pypi/web/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
    100% |████████████████████████████████| 112kB 799kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-install-pasqnywc/MySQL-python/setup.py", line 13, in 
        from setup_posix import get_config
      File "/tmp/pip-install-pasqnywc/MySQL-python/setup_posix.py", line 2, in 
        from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-pasqnywc/MySQL-python/
(py36)



coded by nessus

发表评论

电子邮件地址不会被公开。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据