-1

I am new in Django, recently I have created several project directories under several virtual-environments. Now I have reopened my recent project directory, but forgot which virtual environment I was using for this project. How to find it out?

  • Does this answer your question? [how can I find out which python virtual environment I am using?](https://stackoverflow.com/questions/53952214/how-can-i-find-out-which-python-virtual-environment-i-am-using) – Gino Mempin Aug 02 '22 at 23:58

3 Answers3

0

Provided that you have requirements.txt files for your Django projects (which you really should), it should be as easy as comparing the output of pip freeze under your virtual environments with the contents of your requirements files.

WorkShoft
  • 440
  • 6
  • 18
0

You can use the lsvirtualenv, in which you have two options "long" or "brief".

The "long" option is the default one, it searches for any hook you may have around this command and executes it, which takes more time.

$ lsvirtualenv -b
$ lsvirtualenv -l

Once you have a list of all the virtual environments you can activate them one by one and compare the installed package list with your project requirments.txt file.

pip freeze
Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Shreeyansh Jain
  • 1,407
  • 15
  • 25
-1

use the command

conda info --envs
vimuth
  • 5,064
  • 33
  • 79
  • 116
NJONGO
  • 1
  • 3
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 30 '22 at 15:45
  • The OP doesn't say anything about Anaconda. The point is to answer the question in the OP, not your person situation. Also, this prints the existing conda environments, but does not specify which projects use this environment, so this doesn't answer the question in the OP – Trenton McKinney Aug 02 '22 at 21:24