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 是否报错!

pip安装mysql-python报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-enRreC/mysql-python/

上一篇:centos 安装。net


下一篇:linux安装python