Skip to content
Advertisement

Pip freeze vs. pip list

Why does pip list generate a more comprehensive list than pip freeze?

JavaScript
JavaScript

Pip’s documentation states:

   
freeze Output installed packages in requirements format.
list List installed packages.

What is a “requirements format”?

Advertisement

Answer

One may generate a requirements.txt via:

JavaScript

A user can use this requirements.txt file to install all the dependencies. For instance:

JavaScript

The packages need to be in a specific format for pip to understand, such as:

JavaScript

That is the “requirements format”.

Here, django==1.4.2 implies install django version 1.4.2 (even though the latest is 1.6.x). If you do not specify ==1.4.2, the latest version available would be installed.

You can read more in “Virtualenv and pip Basics“, and the official “Requirements File Format” documentation.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement