-
问题描述
在VSCode中运行python文件,出现如下错误。
PS F:\savedata> conda activate base CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. If your shell is Bash or a Bourne variant, enable conda for the current user with ... ^^^ The above line should NO LONGER be in your ~/.bashrc file! ^^^
-
解决方案
原因是无法在powershell中自动激活conda环境。
参考1给了两种方案,逻辑肯定是对的,但实测对我当下无效。后来发现,当修改lauch.json后单重启VSCode是不行的,重启电脑后可以了。
-
修改默认终端
在lauch.json文件中:
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
-
取消自动激活
在lauch.json文件中:
"python.terminal.activateEnvironment": false
-
手动修改终端
可以在terminal的选择窗口中更改Shell。
Select dedault shell --> Command Prompt
-
-
References
(20200404已解决)conda activeate错误The above line should NO LONGER be in your ~/.bashrc file!
猜你喜欢
转载自blog.csdn.net/The_Time_Runner/article/details/105353375
今日推荐
周排行