简体   繁体   English

无法安装mysql python连接器macOS High Sierra

[英]Cant install mysql python connector macOS High Sierra

When I try installing mysql-python adaptor with pip3 I get this error message: 当我尝试使用pip3安装mysql-python适配器时,出现以下错误消息:

$ pip3 install mysql-python
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 "/private/var/folders/vx/gzl69zd16lg9s4_xsgpnldv00000gn/T/pip-build-qkxwtgtw/mysql-python/setup.py", line 13, in <module>
    from setup_posix import get_config
  File "/private/var/folders/vx/gzl69zd16lg9s4_xsgpnldv00000gn/T/pip-build-qkxwtgtw/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 
/private/var/folders/vx/gzl69zd16lg9s4_xsgpnldv00000gn/T/pip-build- 
qkxwtgtw/mysql-python/

It says it in the error message: 它在错误消息中说:

ModuleNotFoundError: No module named 'ConfigParser'

Python 3 ImportError: No module named 'ConfigParser' Python 3 ImportError:没有名为“ ConfigParser”的模块

  1. ModuleNotFoundError: No module named 'ConfigParser' tells us, that you need ConfigParser to be installed first. ModuleNotFoundError: No module named 'ConfigParser'告诉我们,您需要首先安装ConfigParser。

  2. MySQL-python-1.2.5 seems pretty old. MySQL-python-1.2.5似乎很老。 Not sure if it supports Python 3. Maybe try https://pypi.python.org/pypi/mysqlclient ? 不知道它是否支持Python3。也许尝试https://pypi.python.org/pypi/mysqlclient

  3. If you're on Windows, sometimes it helps to download and install from the .whl 如果您使用的是Windows,有时它有助于从.whl下载和安装

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM