python2.7
|
1
2
3
4
5
6
7
|
yum install -y zlib zlib-devel openssl openssl-devel mysql-devel gcc gcc-c++wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgztar -zxvf Python-2.7.13.tgzcd Python-2.7.13./configure --prefix=/usr/local/python2.7 --with-sslmakemake install |
setuptools
|
1
2
3
4
|
wget https://files.pythonhosted.org/packages/dc/8c/7c9869454bdc53e72fb87ace63eac39336879eef6f2bf96e946edbf03e90/setuptools-33.1.1.zipunzip setuptools-33.1.1.zipcd setuptools-33.1.1/usr/local/python2.7/bin/python2.7 setup.py install |
pip
|
1
2
3
4
|
wget https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz --no-check-certificatetar -zxvf pip-1.3.1.tar.gzcd pip-1.3.1/usr/local/python2.7/bin/python2.7 setup.py installpip install -U pip 升级pip,低版本pip有的时候会有问题
|
升级pip后如果提示
pkg_resources.DistributionNotFound: cffi>=1.8,!=1.11.3
则升级cffi,pip install -U cffi
建立软链接
|
1
2
3
|
cd /usr/binln -s /usr/local/python2.7/bin/pip-2.7 ./pip2.7ln -s /usr/local/python2.7/bin/python2.7 ./python2.7 |
virtualenv
|
1
2
3
|
pip2.7 install virtualenvcd /usr/binln -s /usr/local/python2.7/bin/virtualenv ./ |
virtualenvwrapper
|
1
2
3
4
5
6
7
8
|
pip2.7 install virtualenvwrapper mkdir ~/.virtualenvsvi /etc/profile export WORKON_HOME=~/.virtualenvs export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7source /usr/local/python2.7/bin/virtualenvwrapper.shsource /etc/profile |