无法在python 3.7.3中安装mysqlclient

时间:2019-09-05 14:58:24

标签: python install

无法在python中安装mysql库

pip install mysqlclient


Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/4d/38/c5f8bac9c50f3042c8f05615f84206f77f03db79781db841898fde1bb284/mysqlclient-1.4.4.tar.gz
    ERROR: Command errored out with exit status 1:
     command: //anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b_/p6nrgjnj6b3bvz5vly_1wn1h0000gn/T/pip-install-5hxxbz1f/mysqlclient/setup.py'"'"'; __file__='"'"'/private/var/folders/b_/p6nrgjnj6b3bvz5vly_1wn1h0000gn/T/pip-install-5hxxbz1f/mysqlclient/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 pip-egg-info
         cwd: /private/var/folders/b_/p6nrgjnj6b3bvz5vly_1wn1h0000gn/T/pip-install-5hxxbz1f/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/b_/p6nrgjnj6b3bvz5vly_1wn1h0000gn/T/pip-install-5hxxbz1f/mysqlclient/setup.py", line 16, in <module>
        metadata, options = get_config()
      File "/private/var/folders/b_/p6nrgjnj6b3bvz5vly_1wn1h0000gn/T/pip-install-5hxxbz1f/mysqlclient/setup_posix.py", line 61, in get_config
        libs = mysql_config("libs")
      File "/private/var/folders/b_/p6nrgjnj6b3bvz5vly_1wn1h0000gn/T/pip-install-5hxxbz1f/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.

0 个答案:

没有答案