1.安装python-pip包管理器
1
2
|
sudo apt-get install python-pip sudo apt-get install build-essential python-dev |
不装build-essential和python-dev在装某些包时会报错
2.安装mysql包和MySQL-python包
1
2
|
sudo apt-get install mysql-server mysql-client sudo apt-get install libmysqld-dev |
不装libmysqld-dev会报错:EnvironmentError: mysql_config not found
1
|
sudo pip install MySQL-python |
3.通过pip install安装的包都会存放在/usr/local/lib/python2.7/dist-packages目录下,当使用eclipse的时候可能需要手工将这个路径加入到python解析器的配置中.