MacOS mysqlclient ERROR: Command errored out with exit status 1: python setup.py egg_info Check the

2023-02-18 14:17:03 浏览数 (1)

安装环境

Mac OS

django 2.2

错误日志

代码语言:javascript复制
pip install mysqlclient
代码语言:javascript复制
(qingjiu) yinzhuoqundeMacBook-Pro:QingJiuSystem yinzhuoqun$ pip install mysqlclient

Collecting mysqlclient
  Using cached mysqlclient-1.4.6.tar.gz (85 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/yinzhuoqun/.pyenv/qingjiu/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/pip-egg-info
         cwd: /private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/
    Complete output (12 lines):
    /bin/sh: mysql_config: command not found
    /bin/sh: mariadb_config: command not found
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/setup.py", line 16, in <module>
        metadata, options = get_config()
      File "/private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/setup_posix.py", line 61, in get_config
        libs = mysql_config("libs")
      File "/private/var/folders/s8/71zy7vn50wlbm52k9650cf9h0000gn/T/pip-install-j69_cnqu/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决方法

代码语言:javascript复制
brew install mysql
代码语言:javascript复制
(qingjiu) yinzhuoqundeMacBook-Pro:QingJiuSystem yinzhuoqun$ brew install mysql
Updating Homebrew...
==> Installing dependencies for mysql: protobuf
==> Installing mysql dependency: protobuf
==> Downloading https://homebrew.bintray.com/bottles/protobuf-3.11.4.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/80/809461047f541cfc72d836ea7c7af95ad18f090
######################################################################## 100.0%
==> Pouring protobuf-3.11.4.mojave.bottle.tar.gz



	

0 人点赞