我正在尝试从vscode powershell终端启动conda虚拟环境。powershell终端响应了一些conda命令,比如conda env list
,但是当我试图运行conda init powershell
时,它会在下面抛出一个错误:
conda-script.py: error: argument command: invalid choice: 'C:\\ProgramData\\Anaconda3\\Scripts\\conda-script.py' (choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade', 'remove', 'uninstall', 'config', 'clean', 'package')```
发布于 2022-07-11 15:40:34
我在这个麻烦中挣扎了很长一段时间,但在网上找不到任何解决办法。但我终于找到了。之所以出现这种情况,是因为Windows不允许运行本地PowerShell脚本。它可以在开发人员设置中启用。
在windows 10上
Settings > Update & Security > For developers > Enable PowerShell to run local PowerShell scripts without signing in.
查看在何处启用:
https://stackoverflow.com/questions/70651075
复制相似问题