-
以管理员身份进入Windows Powershell(win+x)
-
执行:
conda init powershell
如果报错CommandNotFoundError: No command 'conda conda'
,一般是由于当前conda版本过高,把conda降级即可conda install -n base conda==x.x.x
。
降级之后重启powershell即可。
如果提示如下报错:
Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。
安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
. : 无法加载文件 C:\Users\87897\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参
阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 3
+ . 'C:\Users\87897\Documents\WindowsPowerShell\profile.ps1'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
输入get-ExecutionPolicy
会输出Restricted
,即脚本执行策略受限。
解决方法:以管理员的身份运行powershell,然后输入set-ExecutionPolicy RemoteSigned
,如果出现选择则选择Y
在输入get-ExecutionPolicy
,查看脚本执行策略会显示RemoteSigned
,问题便已解决。