需要:
A.gcc
B.setuptools
wget -O setuptools-0.6c8.tar.gz http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c8.tar.gz
解压执行 sudo easy_install.py [或者 python setup.py build && sudo python setup.py install]
C.python-dev 在 sudo apt-get install python-dev
否则会报异常:fatal error: Python.h: 没有那个文件或目录
步骤:
B.
$ tar xfz MySQL-python-1.2.3.tar.gz
$ cd MySQL-python-1.2.3
$ cd MySQL-python-1.2.3
$whereis
mysql_config
mysql_config: /usr/bin/mysql_config
$ vim site.cfg
修改mysql_config为mysql配置文件的路径 /usr/bin/mysql_config
$ vim site.cfg
修改mysql_config为mysql配置文件的路径 /usr/bin/mysql_config
还要修改
threadsafe = False
$ python setup.py build
$ sudo python setup.py install
$ python setup.py build
$ sudo python setup.py install