Freezing Installed Python Packages

Academic
Python
Pip
Author

Hailin Wang

Published

March 17, 2023

Freezing Installed Python Packages

Use the pip freeze command to generate a list of installed packages and their versions and save it to the requirements.txt file.

pip freeze > requirements.txt

The requirements.txt file can be used to install the same packages and versions on another machine.

pip install -r requirements.txt
Back to top