Skip to content

Instantly share code, notes, and snippets.

@AntelopeSalad
Last active January 3, 2016 12:19
Show Gist options
  • Save AntelopeSalad/8461854 to your computer and use it in GitHub Desktop.
Save AntelopeSalad/8461854 to your computer and use it in GitHub Desktop.
Installing python from source with virtualenv
sudo apt-get install zlib1g-dev libbz2-dev
# If you plan to use sqlite you will also need:
sudo apt-get install libsqlite3-dev sqlite3 bzip2
# If you plan to use postgres you will also need:
sudo apt-get install libpq-dev python3-dev python-dev
wget http://python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
tar xf Python-3.3.2.tar.bz2
cd Python-3.3.2
./configure --prefix=/usr/local
make && sudo make altinstall
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python3.3 ez_setup.py
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3.3 get-pip.py
sudo apt-get install virtualenvwrapper
# replace .bashrc with the approriate script if you do not use bash
source ~/.bashrc
# making new environments
$ mkvirtualenv my_project
# deleting environments (must be deactivated first)
$ rmvirtualenv my_project
# deactive environment to get back to the system
$ deactivate
# enter a virtual environment
$ workon my_project
# install django or any other python lib and it will be fully contained in the my_project environment
$ pip install django
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment