Python equivalent of npm or rubygems?

The pip tool is becoming the standard in equivalent of Ruby’s gems.

Like distribute, pip uses the PyPI package repository (by default) for resolving and downloading dependencies.

pip can install dependencies from a file listing project dependencies (called requirements.txt by convention):

pip install -r requirements.txt

You can “freeze” the current packages on the Python path using pip as well:

pip freeze > requirements.txt

When used in combination with the virtualenv package, you can reliably create project Python environments with a project’s required dependencies.

Leave a Comment