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?
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.