I did all these commands from the root account, without that your mileage may vary.
Update CentOS and install the development tools
yum -y update yum groupinstall -y 'development tools'I'll want the following packages enabled for Python, and so should you.
yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget
Install Python 2.7.8 from Source
Download and extract the source:wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz xz -d Python-2.7.8.tar.xz tar -xvf Python-2.7.8.tar
Compile the Source and Install
# Enter the directory: cd Python-2.7.8 # Run the configure: ./configure --prefix=/usr/local # compile and install it: make make altinstall # Checking Python version: python2.7 -V # Python 2.7.8
Install pip and virtualenv
No Pythonista worth two dead parrots would be caught dead putting together anything of complexity without these tools. So here's how to install them.# Install pip curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | python2.7 # Install virtualenv pip2.7 install virtualenvAnd you're done.
No comments:
Post a Comment