Best way to install python packages locally for development

Virtualenv allows you to work in completely independent and isolated Python environments. It will let you easily create multiple environments which have different Python packages installed or different versions of a same package. Virtualenv also lets you easily switch between your different environments.

As of 2012, the de facto preferred tool for package management in Python is pip rather than setuptools. Pip is able to handle dependencies and to install/uninstall globally or inside a virtual environment. Pip even comes out-of-the-box with virtualenv.

Python 3

Also worth mentioning is the fact that virtual environments are becoming a part of Python itself in release 3.3, with the implementation of PEP 405.


The Python Packaging User Guide, which "aims to be the authoritative resource on how to package, publish and install Python distributions using current tools", recommends using pip to install in "development mode":

pip install -e <path>

Thus in the root directory of your package you can simply

pip install -e .

See installing from a local source tree.


Install:

http://pypi.python.org/pypi/virtualenv

to set up a localized virtual environment for your libraries, and:

http://pypi.python.org/pypi/setuptools

i.e. "easy_install" to install new things.