Fork me on GitHub

Application Dependencies

Application dependencies are the Python libraries and their versions required for an application to work properly. These dependencies are installed separately from system-level packages to prevent library version conflicts.

The most common way to install Python library dependencies is with the pip command combined with virtualenv to isolate the dependencies of individual applications from each other.

Pip and virtualenv work together and have complementary responsibilities. Pip downloads and installs application dependencies from the central PyPi repository. Virtualenv creates an isolated Python installation is where those dependencies are installed into.

requirements.txt

The pip convention for specifying application dependencies is with a requirements.txt file. When you build a Python web application you should include a requirements.txt file with pegged dependencies.

setup.py

There is another type of dependency specification for Python libraries known as setup.py. Setup.py is a standard for distributing and installing Python libraries. If you're building a Python library, such as requests or underwear you must include setup.py so a dependency manager can correctly install both the library as well as additional dependencies for the library.

Application dependency resources


Next read the static content section.