ubuntu 14.04安裝mysql-python
阿新 • • 發佈:2017-09-13
而是 n-1 targe clas ted 直接 ubun class blog
網上看到的是想安裝mysql-python都得安裝mysql本身,可是我就不想安裝這個數據庫,而是用於連接到別的服務器上的mysql,所以下面就是安裝過程:
1. 直接運行: pip install mysql-python,然後報錯如下:
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
如果是centos,直接運行 這個就可以了: yum install mysql-devel
2. apt-get install python-dev
3. apt-get install libmysqlclient-dev
4. pip install mysql-python 就能成功安裝了
本文轉自:http://blog.csdn.net/wang1144/article/details/50965941
ubuntu 14.04安裝mysql-python