Using pip freeze > requirements.txt will copy the libraries specific to that directory?
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.
Related videos on Youtube
Wunderbread
Updated on September 11, 2022Comments
-
Wunderbread over 1 year
I am using
pip freeze > requirements.txt
and noticed some unfamiliar libraries that were added to the requirements file. Doespip freeze
only capture the libraries and dependencies that are specific to that directory or from the entire system? -
Ron over 3 yearsThx for the hint with
pipreqs
!