Generating a clean requirements.txt with pip-chill

DevNotes
By -
0

pip-chill is a small but very useful tool for generating a clean requirements.txt that only contains top-level dependencies (the packages you actually installed), not all their sub-dependencies like pip freeze does.

How to install ?

Step 1: Install Pip- Chill

[code lang="bash"]

pip install pip-chill

[/code]

Before proceeding, you must ensure that virtual environment is enabled.


Step 2: Create requirements.txt file

Then create file, run this script

[code lang="bash"]
pip freeze > requirements.txt
[/code]

If you see this waring 


Run this script :
[code lang="bash"]
.\.venv\Scripts\pip-chill.exe 2>$null > requirements.txt
[/code]

Desired outcome




Tags:

Post a Comment

0 Comments

Post a Comment (0)
3/related/default