Python development environment and packages on Ubuntu server:


$ sudo apt-get install python-pip python-dev build-essential


Virtualenvwrapper increases your productivity why dealing with virtualenv. If you don’t know virtalenv, then first have a look at it. It is a great tool for managing python packages.


$ sudo pip install virtualenv

Follow this guide. Or follow this quick reference

  • Install
  sudo pip install virtualenvwrapper
  export WORKON_HOME=$HOME/.virtualenvs
  mkdir -p $WORKON_HOME
  • vi ~/.profile
source /usr/local/bin/
  • Zshell users: vi .zshrc
plugins=(git python pip cp django virtualenvwrapper)

Dealing with virtalenv

Create new virtalenv

$ mkvirtualenv project_name

# With pypy

$ mkvirtualenv -p pypy project_name

Set project folder

$ setvirtualenvproject


$ workon environment_name


$ rmvirtualenv environment_name

Upgrade all packages

$ pip install `pip freeze -l | cut --fields=1 -d = -` --upgrade


pip install lxml

first install those apps and then reboot your system

sudo apt-get install libxml2 sudo apt-get install libxslt-dev sudo apt-get install python-dev

It is more easy to install python-lxml and enable site-packages

Enable site-packages:


Pillow needs:

  • sudo apt-get install libjpeg-dev
  • sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev

async: How Do Python Coroutines Work?