Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete python environment

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

like image 240
dgorti Avatar asked Aug 08 '17 05:08

dgorti


People also ask

How do I delete a Python environment?

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.

How do I delete an environment?

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.

How do I delete a virtual environment in PyCharm?

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.

How do I change the Python environment?

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.


2 Answers

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

like image 91
Struck Avatar answered Oct 07 '22 23:10

Struck


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

  • First click this button

Click the button here

  • You will then see this kind of screen

enter image description here

  • Then click the dropdown menu where it shows - packages. Then click the overview tab.
  • Click the delete/remove the enviroment.
  • Your enviroment should now be removed.
like image 3
uinstinct Avatar answered Oct 07 '22 23:10

uinstinct