pip安装mysql-python报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-enRreC/mysql-python/
公司业务开发,用python开发网站;需要使用模块MySQLdb。
我直接pip install MySQLdb,当然不成功了,模块名字因该是mysql-python
pip install mysql-python
最后报错:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-enRreC/mysql-python/
原因是缺少一个依赖:libmysqld-dev
sudo apt-get install libmysqld-dev
然后在执行pip install mysql-python就成功了!
可以进入python的终端验证是否成功!:
import MySQLdb 是否报错!