问题描述
我必须先卸载然后重新安装miniconda。重新安装后,当我运行时,powershell提示符将显示以下消息:
& : The term 'C:\Users\jenj0\anaconda3\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\jenj0\Documents\WindowsPowerShell\profile.ps1:4 char:4
+ (& "C:\Users\jenj0\anaconda3\Scripts\conda.exe" "shell.powershell" "h ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\jenj0\...ripts\conda.exe:String) [],CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
(base) PS C:\Users\jenj0>
此外,miniconda命令提示符窗口根本不会启动。
我试图寻找解决方案。例如,我尝试了this,但是当我尝试启动cmd.exe时,我看到一个快速闪烁的窗口打开然后关闭,却什么也没发生。
我也尝试过再次卸载/重新安装miniconda并遇到相同的问题。我这样做是因为我在运行程序时遇到问题。现在,我距离解决问题还差得远。
解决方法
powershell的启动脚本中有一些无效路径,而cmd
的注册表项中也有无效路径,这是由您先前的anaconda安装引起的。
您说您先卸载了anaconda,然后又安装了miniconda,所以我假设该路径为
C:\Users\jenj0\anaconda3
不存在,现在是
C:\Users\jenj0\miniconda3
这是您的工作:
-
Powershell
(来自您的错误消息)正在尝试读取C:\Users\jenj0\Documents\WindowsPowerShell\profile.ps1
,其中包含对无效路径的引用。备份所述文件,然后删除包含无效路径的所有行 -
cmd
(和anaconda提示符)。运行regedit,然后删除以下项中对无效路径的引用:
Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun