Lock list

A comparison of the outputs shows the differences:

user@user-VirtualBox:~$ pip list feedparser (5.1.3) pip (1.4.1) setuptools (1.1.5) wsgiref (0.1.2) user@user-VirtualBox:~$ pip freeze feedparser==5.1.3 wsgiref==0.1.2 

Protocol Documentation Status

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

but what is the "requirements format" and why does pip list generate a more complete list than pip freeze ?

+62
Sep 23 '13 at 18:46
source share
4 answers

When you use virtualenv , you can specify the requirements.txt file to install all the dependencies.

Typical Usage:

 $ pip install -r requirements.txt 

Packages must be in a specific format for pip to understand that

 feedparser==5.1.3 wsgiref==0.1.2 django==1.4.2 ... 

This is the "requirements format".

Here django==1.4.2 implies the installation of django version 1.4.2 (although the latter is 1.6.x). If you do not specify ==1.4.2 , the latest version will be installed.

You can read more in the Virtualenv and pip Basics "section, and the official documentation file format requirements .

+72
Sep 23 '13 at 18:49
source share

To answer the second part of this question, the two packages shown on the pip list but not pip freeze are setuptools (which is easy_install) and pip itself.

It seems that pip freeze just doesn't display the packages that the choice itself depends on. You can use the --all flag to display these packages as well.

From the documentation :

--all

Do not skip these packages on output: pip, setuptools, distribute, wheel

+22
Feb 04 '15 at 7:50
source share

Check out the pip documentation for a description of the functionality of both:

picket list

List of installed packages, including editable ones.

contour freezing

Display installed packages in requirements format.

So, there are two differences:

  • The freeze output format gives us a standard requirements format that can be used later with pip install -r to install requirements.

  • The output of the pip list includes editable files that pip freeze does not support.

+14
Oct 19 '15 at 5:13
source share

The main difference is that pip freeze output can be dumped to the requirements.txt file and later used to re-construct the frozen environment.

In other words, you can run: pip freeze > frozen-requirements.txt on one computer and then on another computer or in a clean environment that you can do: pip install -r frozen-requirements.txt and you will get an identical environment with those the same dependencies that were installed in the same way as in the original environment where you created the frozen -r equirements.txt.

+8
Mar 13 '18 at 8:39
source share



All Articles