os为centos6.3
- Linxu下编译方法安装python
- [root@lzz opt]# pwd
- /opt
- #下载解压
- [root@lzz opt]# wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
- [root@lzz opt]# tar -zxvf Python-2.7.3.tgz
- [root@lzz opt]# cd Python-2.7.3
- #配置编译
- [root@lzz Python-2.7.3]# ./configure --prefix=/usr/local/python2.7
- [root@lzz Python-2.7.3]# make
- [root@lzz Python-2.7.3]# make install
- #软连接配置
- [root@lzz Python-2.7.3]# ln -s /usr/local/python2.7/bin/python /bin/python2.7
- [root@lzz bin]# python2.7
- Linux下使用setuptools安装类库的过程
- #下载解压
- [root@lzz/opt]#wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
- [root@lzz opt]# tar -zxvf setuptools-0.6c11.tar.gz
- [root@lzz opt]# cd setuptools-0.6c11
- #编译安装
- [root@lzz setuptools-0.6c11]# python2.7 setup.py build
- [root@lzz setuptools-0.6c11]# python2.7 setup.py install
- [root@lzz bin]# ln -s /usr/local/python2.7/bin/easy_install /bin/easy_install-2.7
#类库安装 setuptools方法
#安装django
[root@lzz orangle_liu]# easy_install-2.7 django
# 安装 provy
[root@lzz lib]# easy_install-2.7 provy
#安装类库 setup.py方法
#mysqldb
[root@lzz/opt]#wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=nchc
[root@lzz opt]# tar -zxvf MySQL-python-1.2.3c1.tar.gz
[root@lzz opt]# cd MySQL-python-1.2.3c1
[root@lzz MySQL-python-1.2.3c1]# python2.7 setup.py build
[root@lzz MySQL-python-1.2.3c1]# python 2.7 setup.py install
转载于:https://blog.51cto.com/orangleliu/1159082