ubuntu 14.04安装mysql-python

网上看到的是想安装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 就能成功安装了











你可能感兴趣的:(ubuntu 14.04安装mysql-python)