Home » Python » CentOS installs python2.7, Pip, easy_install

CentOS installs python2.7, Pip, easy_install

centos6 comes with python2.6 version and installs python2.7

as needed
Install dependency Libraries
yum, install, zlib-devel, openssl-devel, mysql, mysql-deve, sqlite-devel

Install Python2.7
wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
Tar XF Python-2.7.8.tgz
CD Python-2.7.8
./configure --prefix=/usr/local
Make & & make install

After the

installation is successful, you can find Python2.7

at /usr/local/bin/python2.7
Install setuptools + pip

note: be sure to use python2.7 to execute the relevant command

#, First, get, the, setup, script, for, Setuptools:
WGet https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
#, Then, install, it, for, Python, 2.7:
Python2.7 ez_setup.py
#, Now, install, Pip, using, the, newly, installed, setuptools:
Easy_install-2.7 pip
#, With, Pip, installed, you, can, now, do,, things, like, this:
Pip2.7 install [packagename]
Pip2.7 install --upgrade [packagename]
Pip2.7 uninstall [packagename]


if after the installation is complete, when the python command is turned into python2.7 without the use of virtualenv, you need to check for the following reasons:

adds a soft link called Python in the Python2.7 bin directory, which points to Python2.7., while the Python2.7 bin directory has a higher priority than the original Python 2.6 bin directory in PATH,.

solution: delete the Python soft link Python2.7 in the bin.