'Visual Studio Code keeps trying to use conda.exe while it has been uninstalled
I have uninstalled conda(Miniconda3) and VSCode, after which I installed python manually and reinstalled VSCode. However VSCode keeps trying to use conda.exe whenever I start the editor or run the debugger.
& : The term 'C:\ProgramData\Miniconda3\Scripts\conda.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Victor\Documents\WindowsPowerShell\profile.ps1:4 char:4
+ (& "C:\ProgramData\Miniconda3\Scripts\conda.exe" "shell.powershell" " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\ProgramData\...ripts\conda.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
This is the error I keep getting. I have checked my global settings.json and local settings.json to no avail. (Edit: conda.exe is not in my user Path or system PATH.)
Interpreter When I manually activate the new env I created for Django it works.
Kind regards, Victor
Solution 1:[1]
I found the solution: In my documents folder there was a folder called "WindowsPowerShell" that had the following code:
#region conda initialize
# !! Contents within this block are managed by 'conda init' !!
(& "C:\ProgramData\Miniconda3\Scripts\conda.exe" "shell.powershell" "hook") | Out-String | Invoke-Expression
#endregion
Removing this folder with file inside fixed the issue! I do not know how this got there. Conda must have done this somehow.
Solution 2:[2]
Is it still in your Windows Environment Variables?
You can check that by going to: System info > Advances > Environment Variables
Next, check for user and system if it is present. Check the variabel Path or PATH in the system box, click edit, and see whether it is in there or not. If so, remove Conda.exe from there.
Solution 3:[3]
- Go to
C:\Users\<username>\Documents\WindowsPowerShell
- Delete the file
profile.ps1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Victor |
Solution 2 | Richard_F96 |
Solution 3 | Chris Kao |