Python newbie here. I am on windows. I installed anaconda a while back for my own user account (not for all users on windows). It installed into c:\users...\local..anaconda and all is good. I might have recently updated anaconda and installed VS 2017.
Now I seem to have 4 python environments.
I tried uninstalling from add-remove programs but some how the environments did not go away.
My questions: 1. Where does Visual Studio get the list of environment names? 2. How do I delete these environments? I just want to keep one and delete all the others
There is no command for deleting your virtual environment. Simply deactivate it and rid your application of its artifacts by recursively removing it. Note that this is the same regardless of what kind of virtual environment you are using.
Delete Environment Variables You need to just use the unset command with the variable name to delete it. This command will remove the variable permanently.
You can clean out old PyCharm interpreters that are no longer associated with a project via Settings -> Project Interpreter, click on the gear in the top right, then click "More". This gives you a listing where you can get rid of old virtualenvs that PyCharm thinks are still around.
By default, the Python extension looks for and uses the first Python interpreter it finds in the system path. To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P). Note: If the Python extension doesn't find an interpreter, it issues a warning.
I deleted the unwanted registry keys from (what solved the problem for me):
HKEY_CURRENT_USER\Software\Python\PythonCore\
The source mentions also the following keys, but they did not exist in my computer:
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore\
Source: https://github.com/Microsoft/PTVS/issues/18
I found my answer to this question here : https://learn.microsoft.com/en-us/visualstudio/python/managing-python-environments-in-visual-studio?view=vs-2019#fix-or-delete-invalid-environments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With