Using pip freeze > requirements.txt will copy the libraries specific to that directory?

10,470

As you have noticed, pip freeze doesn't capture the libraries specific to a directory but indeed all the package installed in the current environment (most likely the packages installed on your system or, if you are in a virtual environment without global access, those from that virtual environment).

You can try pip freeze from an other directory an see that you are having the same results.

If you want to obtain the list of dependency packages for a specific project you might be interested in the pipreqs package which precisely do that.

Share:
10,470

Related videos on Youtube

Wunderbread
Author by

Wunderbread

Updated on September 11, 2022

Comments

  • Wunderbread
    Wunderbread over 1 year

    I am using pip freeze > requirements.txt and noticed some unfamiliar libraries that were added to the requirements file. Does pip freeze only capture the libraries and dependencies that are specific to that directory or from the entire system?

  • Ron
    Ron over 3 years
    Thx for the hint with pipreqs!