Linux系统python2.7虚拟环境下使用pip install MySQL-python安装报错

Nimat ·
更新时间:2024-11-14
· 529 次阅读

Linux系统python2.7虚拟环境下使用pip install MySQL-python安装报错

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

具体错误信息如下:

ERROR: Command errored out with exit status 1: command: /home/lincoln/.virtualenvs/flask_py2/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-BXG78u/MySQL-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-BXG78u/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 /tmp/pip-install-BXG78u/MySQL-python/pip-egg-info cwd: /tmp/pip-install-BXG78u/MySQL-python/ Complete output (10 lines): sh: 1: mysql_config: not found Traceback (most recent call last): File "", line 1, in File "/tmp/pip-install-BXG78u/MySQL-python/setup.py", line 17, in 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. 解决方法:

安装libmysqlclient-dev
sudo apt-get install libmysqlclient-dev
之后再安装
pip install MySQL-python
安装成功

或者参考:https://blog.csdn.net/dqatsh/article/details/2418663


作者:lincoln_lyh



python安装 pip install 环境 Linux install pip Python Mysql

需要 登录 后方可回复, 如果你还没有账号请 注册新账号