pip
Generate requirements.txt
Recored the package name
Run the following command to generate a requirements.txt file:
pip freeze | grep PKG_NAME >> requirements.txt
Another way to generate requirements.txt file is to use the pipreqs package.
Install the package using the following command:
pip install pipreqs
Run
pipreqs
command in the directory where the project is located:pipreqs
Note that the pipreqs
package may not list all the packages that are installed in the virtual environment.
Last updated