from:http://www.chgon.com/?p=1340
Install python2.7.5 tangle for a while, briefly summarize:
1, if you want to compile and install Nodejs, must be installed in advance bzip2
2. If you want to install and manage Python modules with Pip, be sure to install OpenSSL in advance
If you want to use Nodejs and Pip, be sure to install bzip2 and OpenSSL before compiling and installing Python 2.7.5, or you'll have to recompile (I compiled n times, say more tears), start the installation!
First install OpenSSL and BZIP2,BZIP2 installation is not listed here, simply say the installation of OpenSSL, here with Yum installation (began to try to compile the installation with the source code, the installation was successful, but when running Pip, the error, "Importerror: Cannot import name Httpshandler ", or choose to install with Yum, easy, convenient)
Yum Install OpenSSL Yum Install Openssl-devel
Then compile and install python2.7.5
# CD python-2.7. 5 # . // make make install
To run the command:
Python-v
Actually found that the system comes with Python, at this time there is one thing to do
1, create a soft connection, replace the original Python, if not, every time you want to use python2.7 to use absolute address
Ln -s/usr/local/python/bin/python/usr/bin/-v // succeeded 2.7. 5
2, because Yum defaults to use the python2.6, first to change the Yum
vi /usr/bin/yum Change the first line to #!/usr/bin/python2. 6, formerly a #!/usr/bin/python2.
The system comes with the python2.6 and the newly installed python2.7 coexist, if you want to use 2.6, you can use this
#/usr/bin/python2. 6 -2.6. 6
Also recommended is an important Python tool PIP (used to install and manage the Python expansion pack), install Pip
(1) First install Setuptools
Download Setuptools Address: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
# python ez_setup.py
(2) Install Pip
# CD pip-1.4. 1 Install
Install PIP, and immediately experience the power of PIP, such as installing ReadLine
#Yum InstallReadline-devel not installed, you need to install readline-devel#Yum Install PatchIf not installed, you need to installPatch# /usr/local/python/bin/pipInstallreadline Installation # Pythonpython2.7.5(Default, OCTTen -, +: the: -) [GCC4.4.7 20120313(Red Hat4.4.7-3)] on Linux2type" Help","Copyright","credits"Or"License" for Moreinformation.>>> Import ReadLine//Import
OK, python2.7.5 installation is successful!!
Python2.7.5 installation (reprint)