Training Missions

Missions: Using pip and virtualenv

Setup pip and virtualenv


To install pip, virtualenv, virtualenvwrapper and wheel execute the following commands at the terminal for your Linux distro:

On Debian or Ubuntu (this includes Debian/Ubuntu derivative distros like Linux Mint, Xubuntu, Kubuntu, etc.):

sudo apt-get install python-pip python-virtualenv virtualenvwrapper python-wheel

On Fedora (or Fedora derivative distros):

sudo yum install python-pip python-virtualenv python-virtualenvwrapper python-wheel

Some Python packages that have C extensions also require a C compiler so that the C extensions can be compiled. A good example of a package that has such requirements is NumPy, a package for scientific computing with Python.

To install a C compiler on Debian or Ubuntu, at the terminal, type the following command and press Enter:

sudo apt-get install build-essential python-dev

To install a C compiler on Fedora, at the terminal, type the following command and press Enter:

sudo yum install python-devel

Mac OS X

Before you can work with pip and virtualenvs, you'll need to check if Python is installed on your machine; checking for Python on your computer is as simple as opening up the Terminal application and typing python and pressing Enter. If you're greeted with a Python prompt (which looks like >>>), you're good to go; instead if you get an error, we recommend going through the Installing Python on Mac OS X section of the The Hitchhiker’s Guide to Python!