为windows terminal 配置 conda

问题

不显示虚拟环境名,、
也无法conda activate ...

运行conda init powershell 之后,
重启 terminal 显示没法执行profile.ps1

解决方案转载:

打开管理员power shell,修改执行策略,执行:get-ExecutionPolicy,回复Restricted,表示状态是禁止的

Restricted——默认的设置, 不允许任何script运行
AllSigned——只能运行经过数字证书签名的script
RemoteSigned——运行本地的script不需要数字签名,但是运行从网络上下载的script就必须要有数字签名
Unrestricted——允许所有的script运行

执行:set-ExecutionPolicy RemoteSigned即可

输入:conda init,C:\Users\xxx\Documents\WindowsPowerShell下会生成配置文件profile.ps1,重启power shell后,默认会进入conda的base环境,要恢复删除profile.ps1。最后根据个人情况,执行set-ExecutionPolicy Restricted策略改回Restricted。

————————————————
版权声明:本文为CSDN博主「死神萝莉」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010741500/article/details/107154893

posted @ 2021-07-06 11:29  </Venus>  阅读(873)  评论(0编辑  收藏  举报