MySQL-python安装不成功 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the

让人想犯罪 __ 提交于 2019-12-17 23:33:29

报错信息

    ERROR: Command errored out with exit status 1:
     command: /Users/liuzh/Documents/tiger/auth_guardian/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-rCZban/MySQL-python/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-rCZban/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 /private/tmp/pip-install-rCZban/MySQL-python/pip-egg-info
         cwd: /private/tmp/pip-install-rCZban/MySQL-python/
    Complete output (10 lines):
    sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-rCZban/MySQL-python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "setup_posix.py", line 25, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    EnvironmentError: mysql_config not found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决办法

首先安装mysql

参考:https://www.cnblogs.com/xiao-xue-di/p/9655120.html

# 运行
export PATH=${PATH}:/usr/local/Cellar/mysql@5.7/5.7.28/bin

sudo pip install MySQL-Python --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" --global-option="-L/usr/local/opt/openssl/lib"

参考:https://stackoverflow.com/questions/12218229/my-config-h-file-not-found-when-install-mysql-python-on-osx-10-8
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!