【问题标题】:unable to install MYSQLDB无法安装 MYSQLDB
【发布时间】:2022-01-14 23:26:32
【问题描述】:
sudo pip install MySQL-python
Collecting MySQL-python
  Using cached MySQL-python-1.2.5.zip (108 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4dq45q4u/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4dq45q4u/MySQL-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-4dq45q4u/MySQL-python/pip-egg-info
         cwd: /tmp/pip-install-4dq45q4u/MySQL-python/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-4dq45q4u/MySQL-python/setup.py", line 13, in <module>
        from setup_posix import get_config
      File "/tmp/pip-install-4dq45q4u/MySQL-python/setup_posix.py", line 2, in <module>
        from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
neosoft@neosoft:~$ ^C

【问题讨论】:

  • 欢迎来到 StackOverflow!抱歉,我可以问你是否可以改进一下你的问题以使其更具可读性?现在它是一堵文字墙。在这种情况下很难为您提供帮助。非常感谢。
  • 试试sudo pip3 install ...
  • sudo pip install ConfigParser

标签: python pip mysql-python


【解决方案1】:

你的问题在这里:

No module named 'ConfigParser'

该模块在 Python 3 中已重命名为 configparser。因此,您似乎正在尝试在 Python 3 环境中安装 mysql 的 Python 2 版本。

【讨论】:

    猜你喜欢
    • 2019-02-09
    • 2017-07-30
    • 2019-06-15
    • 1970-01-01
    • 2019-11-17
    • 2018-11-27
    • 2022-01-04
    • 2015-12-13
    相关资源
    最近更新 更多