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