On my notebook, Visual Studio Code (VS Code) does not execute my python files anymore.
Yesterday it worked fine, then VS Code suggested me to update powershell from version 5.2 to 7. I did the update, know if I open my python file an try to run without debugging, the script is not executed.
Can someone help me with this issue?
My script for testing is only: print("Hello World")
What looks a bit strange for me is, that in the bottom right corner it shows the python version 3.6.10:
If I go to command prompt an choose Command Prompt, it shows python version 3.6.10 too:
But if I go to powershell (The first selection ind the picture above) it shows me another python version:
I hope someone can help me, I have no idea what to do anymore. Thanks!
Best regards,
Daniel
Added later:
Control bar which shows up for a very short time (Not even a second):
The python3.6 version is no longer supported in the latest debugger version.
Please use the new python version. Or install the historical version debugger.
Related
I face the same problem as VS Code "Run selection/line in Python interactive window" not working at all, yet using Bisect to disable and detect the reasons through extensions didn't help. For me the problem started after VScode itself was updated yesterday.
VS Code version: 1.75.1
Python version: 3.9.13
Python VS Code extension: 2023.2.0
This command "Shift + Enter" just stopped working in full all of a sudden. It runs for a single line selected, but not for multiple. I cannot find why.
It is just time consuming to copy and paste the same code in the interactive code to run it.
Any ideas how I can fix it?
This problem seems to be caused by the 1.75.1 update. I solved this problem by using the old version of vscode. You can install the old version of vscode here.
By the way, you can also submit the problem to github/VsCode for repair.
When starting a python script in debug mode from VS code nothing happens. I do not see any command being lunched in terminal.
If I start the script without debugging it starts fine.
I read on another thread somewhere that choosing an older Python extension like 2021.12.1559732655 would fix it and indeed it does but I would like to use the latest version of Python extension.
Anyone has any idea what broke in the new extensions starting with 2022.. basically anything with 2022 will not do anything when attempting to start the script in debug.
I am running remotely from a windows using ssh on a centos7 with python 2.7 and python 3.6. Not sure if that matters.
I tried starting python scripts from Visual Studio code in debug mode
VS code does not do anything.
Tried modifying the config , restart , switching back to python 2.7 without result..
The only thing that works is reverting to a version pre 2022
Seems that I got my answer on ghithub. The debugger will not work with versions lower than Python 3.7.
For anything other than Python 3.7+ (like Python 2.6 ) use the 2021.12 version of the vs code python extension.
https://github.com/microsoft/vscode-python/issues/19559#issuecomment-1358494296
I am a Windows 10 user, and had configured the Python 3.10 IDLE to dark mode and had added the Fira Code font to the IDLE a few days back (Through the Options menu). Then the Python IDLE was working fine; without issues.
However, each time after that when I try to go to 'Configure IDLE' from Options Menu, Python IDLE just freezes and then stops responding, until I manually close it. It then asks to run a Windows check and reports the error to Windows. I have tried uninstalling and reinstalling Python; however that did not work.
Image: Python has stopped responding (happens everytime I click on configure IDLE)
I am a Windows user and tried running python from cmd using the command: py -m idlelib to start IDLE from the command line to try and get an error report, however the same problem happens as mentioned above, and I do not get an error report when I close Python. I tried finding solutions in similar questions, however I did not understand what was going on. I also do not seem to figure out how 'running the Python IDLE' through the command line works, other than running it using the above command. Can someone please assist me on what to do next at this point, that would be of huge help :D
Try uninstalling the font. The Doesn't work part of the Editor compatibility list on https://github.com/tonsky/FiraCode includes IDLE. I suspect that the font is incompatible with tcl/tk. Your report is similar to
IDLE Settings window won't appear
See https://bugs.python.org/issue45103 for so far futile efforts to protect IDLE.
UPDATE: We were not able to reproduce the problem with FireCode. However, the BPO issue referenced above lead to a tcl/tk bug report that lead to a bugfix, at least for the Phaistos font, that is included in tcl/tk 8.6.12. This is included in the new Python 3.9.9 Windows installer and will be in the upcoming 3.10.1 installer. It might fix your issue with FiraCode.
Whenever I try to run my python code or even the simplest hellow command in VS Code's termilnal, it is just showing this:
C"/users/admin/document/my python file
Why does it happen?
Oh, this is more like an VS-Code question. But anyways: I believe you have to use a command to run the file, just like this:
py <file-path-here>
Example:
py example.py
Also, maybe try installing the Python extension in VSCode.
And make sure you have Python installed correctly (check the button "add Python to path" in the first page of the Python installation setup).
If all of this does not work, make sure to select the correct Python version in VSCode by doing this:
Go to top menu, click view, command pallete, type Python Select Interpreter and choose the correct version.
Also, check if the file ends with .py so VSCode knows that you are working with a Python file.
Since you're new here: you can support me a lot by upvoting this answer or marking this as an answer. <3 Thanls
Environments
OS:Windos 7, x64 bit
Vim: gvim74 from vim.org
Python: Python 2.7.11
UltiSnips: just downloaded from github
Gvim worked perfectly for me with SnipMate for a long time and lately I want to use UltiSnips instead. So i newly installed python on my PC, installed UltiSnips with Pathogen and just deleted snipmate, hoped it works well but it doesn't.
The problem is: When I open gvim, it exits as soon as I press "i". Then I recovered gvim before I installed UltiSnips and simply executed a command on gvim like "python print "Hello"" or "python 1" or so, It does nothing but causes gvim to exit instantly, just like a executed "q!" command.
OK It probably is a problem happens when gvim encounters python while does nothing with UltiSnips. Hope for suggestios or methods to solve this. Thanks all your guys.
Problem solved. I downgraded python from 2.7.11 to 2.7.9 and it worked well. – Cicero