【问题标题】:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-1qgj63ha/mysqlclient/命令“python setup.py egg_info”在 /tmp/pip-build-1qgj63ha/mysqlclient/ 中失败,错误代码为 1
【发布时间】:2018-05-18 16:18:13
【问题描述】:

在 CentOS7.2 中,我通过 pip3 安装 mysql 客户端,但出现以下错误:

[root@controller src]# pip3 install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-1.3.12.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: did not find the command
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-1qgj63ha/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/tmp/pip-build-1qgj63ha/mysqlclient/setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "/tmp/pip-build-1qgj63ha/mysqlclient/setup_posix.py", line 26, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    OSError: mysql_config not found

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

众所周知,Python3 的 mysqlclient 是 Python2 的 MySQL-python 的替代品。但是为什么在CentOS7.2我不能安装呢?

【问题讨论】:

标签: mysql pip mysql-python pip3


【解决方案1】:

最后,我发现我应该先安装mysql并配置它,如果不安装它会出现OSError: mysql_config not found这个错误。

yum install python-devel mysql-community-devel -y

【讨论】:

    猜你喜欢
    • 2018-11-12
    • 2017-12-13
    • 2021-10-23
    • 2016-02-14
    • 2023-04-01
    • 2019-08-24
    • 2018-05-28
    • 2015-06-06
    • 2022-01-13
    相关资源
    最近更新 更多