赞
踩
VScode安装好以后,打开一个Python文件,需要选择一个Python解释器
2.选中python:select interpreter 选择要使用的Python解释器
3.配置文件中进行配置:
- lauch.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: /home/user/anaconda3/envs/test/bin/python",
-
- "type": "python",
-
- "request": "launch",
-
- "program": "*/plot.py",
-
- "console": "integratedTerminal",
-
- "justMyCode": true,
-
- "externalConsole":false,
-
- }
-
- ]
-
- }

[Python][VsCode]报错 python:命令“Python:Select:Interpreter“ command ‘python.setInterpreter‘ not found
错误情况:
在使用ctrl+shift+P后使用Python:Select:Interpreter切换解释器出错
报错如下
解决方案:
在左侧扩展栏目中搜索@workspaceUnsupported
发现python在限制在受限模式下
点击蓝圈中选项
然后选择信任,问题解决
原文链接:https://blog.csdn.net/m0_56738500/article/details/127144144
(4)运行命令添加参数:添加”args“字段
其中的args就是我们需要添加的参数项,根据程序里面设置的参数项进行设置即可,我这里是已经添加好了的。保存后点击界面右上角的Debug Python File按钮,发现还是报同样的错误。可是参数已经在launch.json文件里面进行设置了的。这也许是因为vscode自身bug的原因,在设置好调试文件后不能直接通过Debug Python File按钮运行,而要按键盘上的F5运行,这样就不会报错了,对应的参数也都能传进去。
原文链接:https://blog.csdn.net/weixin_44120025/article/details/121246123
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。