Child pages
  • Python Development
Skip to end of metadata
Go to start of metadata


Here are some development guidelines when working with python.

The environment.

Java has Maven, Ruby has Gems, Perl has CPAN, Python has pypi.

The PYthon Package Index is the index for all python packages. Most packages that you use will be on pypi.

For years, the way to install a python package was `easy_install <package_name>`, which came with the setuptools package. However, it is being replaced with pip.

Enter virtualenv

virtualenv is the preferred way to create isolated python environments.

It creates a sandboxed python environment.

$ virtualenv env

This will create a directory – env – in the current working directory which contain the "virtual" python that you will need to use. You can switch into the environment like so (assuming a Bourne-compatible shell):


Activate, you have to do this in order to use the environment.

$ source env/bin/activate

Installing your dependencies

Now, say that you want to use Django. You can do so:

(env)$ pip install Django

Managing your dependencies

Working with someone? Then you should put a "requirements.txt" file on the top-level. A sample requirements file looks like:


Then, your buddy can install all the right packages simply by running:

$ pip install -r requirements.txt

The code.


This is not Java

Unknown macro: {tm}


When in doubt, follow PEP 8.

  • No labels