Install Python 2.7, Pip, Virtualenv under Fedora, RedHat Linux and CentOS

While developing the RhodeCode Installer I found a good (and reliable!) way to install Python 2.x, Pip (PyPI) and Virtualenv under current Fedora, RedHat Enterprise and CentOS Linux systems. I added an additional line after each line to make it more clear what should go on the same line.

Firstly, we install Python and make/build tools and then download a custom script which itself downloads and builds Pip. After that we update Pip just in case and install virtualenv:

sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y

sudo yum install python-devel -y

sudo curl -o /tmp/ez_setup.py https://sources.rhodecode.com/setuptools/raw/bootstrap/ez_setup.py

sudo /usr/bin/python /tmp/ez_setup.py

sudo /usr/bin/easy_install pip

sudo rm setuptools-*.tar.gz

sudo pip install -i https://pypi.rhodecode.com/ –upgrade pip

sudo pip install virtualenv

 

 

 

参考文章:https://github.com/0xdata/h2o/wiki/Installing-python-2.7-on-centos-6.3.-Follow-this-sequence-exactly-for-centos-machine-only

坚持原创技术分享,您的支持将鼓励我继续创作!