【发布时间】:2022-10-09 05:10:33
【问题描述】:
在cmd和powershell中,当我输入conda init powershell时,总是失败如下:
(ifcmapping) C:\Windows\system32>conda init powershell
no change C:\Users\haoli\anaconda3\Scripts\conda.exe
no change C:\Users\haoli\anaconda3\Scripts\conda-env.exe
no change C:\Users\haoli\anaconda3\Scripts\conda-script.py
no change C:\Users\haoli\anaconda3\Scripts\conda-env-script.py
no change C:\Users\haoli\anaconda3\condabin\conda.bat
no change C:\Users\haoli\anaconda3\Library\bin\conda.bat
no change C:\Users\haoli\anaconda3\condabin\_conda_activate.bat
no change C:\Users\haoli\anaconda3\condabin\rename_tmp.bat
no change C:\Users\haoli\anaconda3\condabin\conda_auto_activate.bat
no change C:\Users\haoli\anaconda3\condabin\conda_hook.bat
no change C:\Users\haoli\anaconda3\Scripts\activate.bat
no change C:\Users\haoli\anaconda3\condabin\activate.bat
no change C:\Users\haoli\anaconda3\condabin\deactivate.bat
no change C:\Users\haoli\anaconda3\Scripts\activate
no change C:\Users\haoli\anaconda3\Scripts\deactivate
no change C:\Users\haoli\anaconda3\etc\profile.d\conda.sh
no change C:\Users\haoli\anaconda3\etc\fish\conf.d\conda.fish
no change C:\Users\haoli\anaconda3\shell\condabin\Conda.psm1
no change C:\Users\haoli\anaconda3\shell\condabin\conda-hook.ps1
no change C:\Users\haoli\anaconda3\Lib\site-packages\xontrib\conda.xsh
no change C:\Users\haoli\anaconda3\etc\profile.d\conda.csh
needs sudo C:\Users\haoli\OneDrive\??\WindowsPowerShell\profile.ps1
No action taken.
Operation failed.
我已经以管理员身份运行。如何解决?谢谢!
【问题讨论】:
-
从底部开始的 3d 行中的
\??\是输出行的文字部分,还是您编辑信息的结果? -
这是文字部分@mklement0
-
这听起来像个问题,因为没有文字路径可能包含
?字符。从 PowerShell 控制台,$PROFILE报告什么? -
我在 PowerShell 控制台中输入了
notepad $PROFILE,但弹出一条消息说“系统找不到指定的路径”@mklement0 -
$PROFILE应包含用户和 PowerShell 主机特定配置文件的完整路径。您的症状表明该路径已损坏,或者该文件尚不存在。要排除后者,请运行if (-not (Test-Path -LiteralPath $PROFILE)) { New-Item -Force $PROFILE }
标签: powershell anaconda conda