CentOS6.9 Python环境配置(python2.7、pip、virtualenv)
python2.7
yuminstall-yzlibzlib-developensslopenssl-develmysql-develgccgcc-c++ wgethttps://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz tar-zxvfPython-2.7.13.tgz cdPython-2.7.13 ./configure--prefix=/usr/local/python2.7 make makeinstall
setuptools
wgethttps://files.pythonhosted.org/packages/dc/8c/7c9869454bdc53e72fb87ace63eac39336879eef6f2bf96e946edbf03e90/setuptools-33.1.1.zip unzipsetuptools-33.1.1.zip cdsetuptools-33.1.1 /usr/local/python2.7/bin/python2.7setup.pyinstall
pip
wgethttps://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz--no-check-certificate tar-zxvfpip-1.3.1.tar.gz cdpip-1.3.1 /usr/local/python2.7/bin/python2.7setup.pyinstall
建立软链接
cd/usr/bin ln-s/usr/local/python2.7/bin/pip-2.7./pip2.7 ln-s/usr/local/python2.7/bin/python2.7./python2.7
virtualenv
pip2.7installvirtualenv cd/usr/bin ln-s/usr/local/python2.7/bin/virtualenv./
virtualenvwrapper
pip2.7installvirtualenvwrapper mkdir~/.virtualenvs vi/etc/profile exportWORKON_HOME=~/.virtualenvs exportVIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 source/usr/local/python2.7/bin/virtualenvwrapper.sh source/etc/profile
总结
以上所述是小编给大家介绍的CentOS6.9Python环境配置(python2.7、pip、virtualenv),希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的!