Linux中Python 环境软件包安装步骤
简介:
记录一下关于Python环境软件包的一些安装步骤
1、升级Python到2.7.10(默认2.6.6)
shell>yum-yinstallepel-release shell>yum-yinstallgccwgetreadline-develzlib-developenssl-devel shell>wgethttps://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz shell>tarzxfPython-2.7.10.tgz shell>cdPython-2.7.10;./configure--prefix=/usr/local/python2.7;make;makeinstall shell>mv/usr/bin/python/usr/bin/old_python shell>ln-s/usr/local/python2.7/bin/python/usr/bin/python shell>sed-i'1s/python/old_python/'/usr/bin/yum shell>python-V Python2.7.10
##这样就实现的python的升级
##readline-devel这个包要事先安装,不然后面的ipython不支持tab、方向键等,还要重新编译python
##zlib-devel这个包Setuptools会用到,openssl-devel这个包pip会用到
##/usr/bin/yum文件解释器要改一下,不然无法使用yum
2、安装Setuptools
shell>wgethttps://pypi.python.org/packages/source/s/setuptools/setuptools-15.2.tar.gz#md5=a9028a9794fc7ae02320d32e2d7e12ee shell>tarzxfsetuptools-15.2.tar.gz shell>cdsetuptools-15.2;pythonsetup.pyinstall shell>ln-s/usr/local/python2.7/bin/easy_install/usr/bin/easy_install
##这样Setuptools也安装好了,如果不安装这个包直接下载pip源码包安装可能会报错说找不到Setuptools
3、安装pip
shell>wgethttps://pypi.python.org/packages/source/p/pip/pip-6.1.1.tar.gz#md5=6b19e0a934d982a5a4b798e957cb6d45 shell>tarzxfpip-6.1.1.tar.gz shell>cdpip-6.1.1;pythonsetup.pyinstall shell>ln-s/usr/local/python2.7/bin/pip/usr/bin/pip
##这样pip也安装好了,当然,有了easy_install就可以直接easy_installpip了,源码只是另外一种安装方式
4、安装ipython
shell>wgethttps://pypi.python.org/packages/source/i/ipython/ipython-3.1.0.tar.gz#md5=a749d90c16068687b0ec45a27e72ef8f shell>tarzxfipython-3.1.0.tar.gz shell>cdipython-3.1.0;pythonsetup.pyinstall shell>ln-s/usr/local/python2.7/bin/ipython/usr/bin/ipython
##这样ipython也安装好了,同样可以通过pipinstallipython来快速安装