EnvironmentError: mysql_config not found

 
Ubuntu上安装执行
pip install MySQL-python
命令安装
MySQL-python
报错
(env_flask)eason@eason-virtual-machine:~/PycharmProjects/exam$ pip install MySQL-python
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-QSrcxF/MySQL-python/setup.py", line 17, in <module>
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

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-QSrcxF/MySQL-python
(env_flask)eason@eason-virtual-machine:~/PycharmProjects/exam$


 解决办法:
 
sudo apt-get install libmysqlclient-dev

0 个评论

要回复文章请先登录注册