本文主要是介绍vscode没法选python解释器interpreter,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题比较复杂,尝试以下方案,
(1)这个错误是由配置引起的,关闭vscode,
ctrl+H
显示配置文件,在/home/user/.config下,删除这个文件夹(里面包含错误的配置),
/home/user/.config/code
然后就可以正常配置vscode了。
(2)在launch.json中直接添加路径,
{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [ {"name": "Python: 当前文件","type": "python","request": "launch","program": "${file}","console": "integratedTerminal","python": "/home/user/anaconda3/envs/torch/bin/python","justMyCode": false}]
}
(3) 修改inheritEnv设置
vscode有时会提示这么个东东,
在GUI中配置,
或者,在settings.json中配置
“terminal.integrated.inheritEnv”: false,
这篇关于vscode没法选python解释器interpreter的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!