pythonlinux

How to revert pip freeze > requirements.txt?


I already had a requirements.txt, but I used the

pip3 freeze > requirements.txt

and then

pip3 install -r requirements.txt

This operation covered my original file. Is there any ways to revert the pip freeze?

By the way, I created a virtual environment by

python3 -m venv <DIR>

If I delete this virtual environment, will this work?


Solution

  • Actually there is no pip command to revert that. You just need to delete the venv folder and initialize new one.