Skip to content

Instantly share code, notes, and snippets.

@joncasdam
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joncasdam/847a7acc5e601d8f5764 to your computer and use it in GitHub Desktop.
Save joncasdam/847a7acc5e601d8f5764 to your computer and use it in GitHub Desktop.
Installing Python 2.7.8 on CentOS 6.x where Python 2.6.x is the current version
# Python 2.7.8 alongside 2.6 in CentOS
# based on Juliano Resende's tutorial at http://www.gorobei.net/instalando-o-python-2-7-8-no-centos-6-x/
# Make sure that your user is on sudoers and wheel group
$ usermod -G wheel usuario
# Some installing before going to python it self
$ yum update
$ yum install gcc44 gcc44-c++ gcc44-gfortran
$ yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget
$ yum groupinstall -y 'development tools'
# Downloading and installing Python 2.7.8
$ wget https://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
# Making it a alternative in CentOS
$ ./configure --prefix=/usr/local && make && make altinstall
# Getting Setuptools
$ wget https://bootstrap.pypa.io/ez_setup.py -O - | python2.7
# Getting PIP
$ wget https://bootstrap.pypa.io/get-pip.py -O - | python2.7
# Install virtualenv and virtualenvwrapper
$ pip install virtualenv
$ pip install virtualenvwrapper
# Set your .bash_profile so virtualenvwrapper use python2.7
$ export WORKON_HOME=$HOME/www/.virtualenvs
$ export PROJECT_HOME=$HOME/www
$ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python2.7
$ export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
$ source /usr/local/bin/virtualenvwrapper.sh
# Salve, exit and run
$ source ~/.bash_profile
# You're good to go!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment