Inconsistent behavior of "Run Python File" command #25466
-
I'm experiencing different behavior when running Python files through the VSCode Python extension using the "Run Python File" command on two different computers. Both installations were configured as default with miniforge for conda, and the same versions of Windows 11, VSCode, Python, and the Python extension. Computer 1 (working correctly): Computer 2 (problematic): The issue is that Computer 2 is missing the --live-stream flag, which prevents real-time output streaming. Are there any ways that I can configure to include the --live-stream flag? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Would anybody be able to help with this? |
Beta Was this translation helpful? Give feedback.
-
I’ve seen this happen too. The --live-stream flag isn’t something you can flip on with one setting, it’s added automatically depending on how the VS Code Python extension runs your code. On the computer where it’s missing, open your VS Code settings (Ctrl + ,) and search for Python: Terminal. Make sure it’s set to use the integrated terminal instead of the output window. That’s usually what controls whether live output shows up. If it still doesn’t behave, you can force it by editing your settings.json and adding:
That will tell VS Code to always add the flag when it runs your Python files. |
Beta Was this translation helpful? Give feedback.
-
Hi! Depending on if you in the experiment or not described here you may see different behavior but I am trying to unify it. If you could add |
Beta Was this translation helpful? Give feedback.
Hi! Depending on if you in the experiment or not described here you may see different behavior but I am trying to unify it. If you could add
"python.useEnvironmentsExtension": true
to your settings, update the Python Environments Extension to the newest pre-release version, and then try again that would be extremely helpful. You should now see it just usespython xxx
instead ofconda run
which should keep the streaming behavior you want but just with a different way of running it. Let me know if that behaves as expected for you!