0

I had venv that installed Django and python version3.8. After upgrading my ubuntu my virtual environment doesn't work anymore and it doesn't recognize the pip command and it returns:

ModuleNotFoundError: No module named 'pip'

After searching I found out the virtual environment is broken after upgrading and the best way is to remove venv directory and create again and install your packages again but I don't have my installed package list (using pip freeze > list.txt) so now how can I get installed package list from the broken virtual environment? I can see the list of directories here:

$ ls venv/lib/python3.8/site-packages/ 

but I don't have it

minttux
  • 435
  • 4
  • 8
  • 19
  • I think, this maybe linking error which mentioned https://stackoverflow.com/questions/23233252/broken-references-in-virtualenvs/25947333#25947333. Could you share `$HOME/.virtualenvs/` – maxemilian Jul 15 '23 at 09:58
  • it's: $ ls $HOME/.virtualenvs ls: cannot access '/home/mrg/.virtualenvs': No such file or directory – minttux Jul 15 '23 at 10:16
  • What do you mean you can see list of dirs but you don't have it? site-packages should be still inside the venv dir, restore the list manually, and let it be a lesson to use something like poetry in the future (or keeping the requirements list updated) Yes, that's partially a pip fault for being so basic and not keeping a ready list of what was added with it, but you are also responsible to make sure you have your requirements down. – Gin Fuyou Jul 15 '23 at 13:27

0 Answers0