简体   繁体   English

在使用 Python 的 vscode 中,ctrl+F5 总是要求“选择环境”

[英]In vscode using Python, ctrl+F5 always asks for “select environment”

I installed VSCode, downloaded official Python 3.6.4.我安装了 VSCode,下载了官方 Python 3.6.4。

VSCode detected and set the environment right - I do see "python.pythonPath" user setting set correctly. VSCode 检测到并正确设置环境 - 我确实看到“python.pythonPath”用户设置设置正确。

But, when using VS Code using Ctrl + F5 to run a Python file, I am always getting asked for "select environment" and it shows me two options - Python - Python Experimental但是,当使用Ctrl + F5使用 VS Code 运行 Python 文件时,我总是被要求“选择环境”,它向我显示了两个选项 - Python - Python 实验

What is this "Python Experimental"?这是什么“Python 实验”? How can I get rid of getting interrupted every time I try to run a script?每次尝试运行脚本时如何避免被打断?

Run > Add Configuration... => Choose one of the two options. Run > Add Configuration... => 选择两个选项之一。

After doing this it will no longer prompt you.执行此操作后,它将不再提示您。

Ctrl + F5 is a shortcut to Start without Debugging What you want is just running a file according to your post. Ctrl + F5Start without Debugging的快捷方式你想要的只是根据你的帖子运行一个文件。 To run a python file in the integrated terminal, right-click your editor window and Run Python File in Terminal .要在集成终端中运行 python 文件,请右键单击编辑器窗口并Run Python File in Terminal It should open up a terminal window within VS Code and run as normal.它应该在 VS Code 中打开一个终端窗口并正常运行。 It also takes into account the environment you are currently using whenever you run it.每当您运行它时,它还会考虑您当前使用的环境。

To answer your other question about Python Experimental , it is an option to use the experimental debugger, an alternate version of a Python Debugger.要回答有关Python Experimental其他问题,可以选择使用实验调试器,这是 Python 调试器的替代版本。 You can read the instructions here您可以在此处阅读说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Visual Studio Code (Python) 中使用调试/运行按钮和 F5/Ctrl+F5 时的不同行为 - Different behavior when using Debug/Run button and F5/Ctrl+F5 in Visual Studio Code (Python) VSCode 1.39.x 和 Python 3.7.x:“ImportError:尝试在没有已知父包的情况下进行相对导入”- 在没有调试的情况下启动时 (CTRL+F5)) - VSCode 1.39.x & Python 3.7.x: "ImportError: attempted relative import with no known parent package" - when started without debugging (CTRL+F5)) 在用于python的visual studio工具中点击ctrl + F5后,控制台窗口立即关闭 - Console windows closes right after I hit ctrl+F5 in visual studio tools for python Visual Studio Code 仅从 Ctrl+F5 执行文件 - Visual Studio Code executes file only from Ctrl+F5 我如何使用 os.environ select 环境变量(使用 VSCode 和 Python) - How do I select environment variables using os.environ (using VSCode & Python) 如何使用 VSCode 在虚拟环境中调试 python 代码? - How can I debug a python code in a virtual environment using VSCode? 如何使用快捷键 ctrl + # 在 Python 或 C++ 中使用 Vscode 注释多行代码? - How can I use the shortcut ctrl + # to comment multiple lines of code in Python or C++ using Vscode? VSCode 上的 Python 未在所选环境中运行 - Python on VSCode not Running on the Selected Environment python vscode 环境变量不可用 - python vscode environment variables not available 在 VSCode Jupyter 中使用环境变量 - Using environment variables with VSCode Jupyter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM