安装 mysqlclient==1.3.12 报错:OSError: mysql_config not found

安装 mysqlclient==1.3.12 报错:OSError: mysql_config not found

Collecting mysqlclient==1.3.12
  Using cached mysqlclient-1.3.12.tar.gz (89 kB)
    ERROR: Command errored out with exit status 1:
     command: /opt/venv/loonflow-env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-e7vew8q9/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-e7vew8q9/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 /tmp/pip-install-e7vew8q9/mysqlclient/pip-egg-info
         cwd: /tmp/pip-install-e7vew8q9/mysqlclient/
    Complete output (10 lines):
    /bin/sh: mysql_config: 未找到命令
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-e7vew8q9/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-e7vew8q9/mysqlclient/setup_posix.py", line 44, in get_config
        libs = mysql_config("libs_r")
      File "/tmp/pip-install-e7vew8q9/mysqlclient/setup_posix.py", line 26, 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.

解决方式:

yum install python3-devel mysql-devel  #python3的开发环境
yum install python-devel mysql-devel   #python2的开发环境
发布了2 篇原创文章 · 获赞 0 · 访问量 22

猜你喜欢

转载自blog.csdn.net/Jessica0811/article/details/104290536