[英]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.我已经卸载了 conda(Miniconda3) 和 VSCode,之后我手动安装了 python 并重新安装了 VSCode。 However VSCode keeps trying to use conda.exe whenever I start the editor or run the debugger.
但是,每当我启动编辑器或运行调试器时,VSCode 一直尝试使用 conda.exe。
& : 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.
我检查了我的全局设置。json 和本地设置。json 无济于事。 (Edit: conda.exe is not in my user Path or system PATH.)
(编辑:conda.exe 不在我的用户路径或系统路径中。)
Interpreter When I manually activate the new env I created for Django it works.解释器当我手动激活我为 Django 创建的新环境时,它可以工作。
Kind regards, Victor亲切的问候,维克多
Is it still in your Windows Environment Variables?它还在您的 Windows 环境变量中吗?
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.
如果是这样,请从那里删除 Conda.exe。
I found the solution: In my documents folder there was a folder called "WindowsPowerShell" that had the following code:我找到了解决方案:在我的文档文件夹中有一个名为“WindowsPowerShell”的文件夹,其中包含以下代码:
#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.
康达一定以某种方式做到了这一点。
C:\Users\<username>\Documents\WindowsPowerShell
C:\Users\<username>\Documents\WindowsPowerShell
profile.ps1
profile.ps1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.