python安装心得,以及MySQLdb的安装

1.Python-2.6.5.tar.bz2

tar jxvf Python-2.6.5.tar.bz2
cd  Python-2.6.5
./configure --prefix=/usr/local/python
make
make install
cp /usr/local/python/bin/python /usr/bin/python -rf


2.setuptools-0.6c9.tar.gz 
tar zxvf setuptools-0.6c9.tar.gz
cd setuptools-0.6c9
python setup.py install



3.MySQL-python-1.2.3c1.tar.gz 
tar zxvf MySQL-python-1.2.3c1.tar.gz
cd MySQL-python-1.2.3c1
python setup.py install




4.pysnmp-4.1.13a.tar.gz 
tar zxvf pysnmp-4.1.13a.tar.gz 
cd pysnmp-4.1.13a
python setup.py install




5.pyasn1-0.0.11a.tar.gz 
tar zxvf pyasn1-0.0.11a.tar.gz 
cd pyasn1-0.0.11a
python setup.py install


6.Django-1.2.3.tar.gz
tar zxvf Django-1.2.3.tar.gz
cd Django-1.2.3
python setup.py install


7.设置环境变量
vi /root/.bashrc
export PATH="$PATH:/usr/local/python/lib/python2.6/site-packages/django/bin/"
chmod +x  /usr/local/python/lib/python2.6/site-packages/django/bin/*



如果安装MySQLdb的模块报错:
修改site.cfg:
mysql_config = /usr/local/mysql/bin/mysql_config 

你可能感兴趣的:(安装,python,mysqldb模块)