Before installing Visual Studio 2017, all my python files were successfully running using py (or py3) in PowerShell, Git Bash, and Cygwin Terminal, but not CMD.exe or MSYS:
py myscript.py
This executable was installed directly by the Python 3.7 installer, and I configured the path variables for it.
After installing VS 2017, Microsoft inserted the path to their VS-specific copy of py.exe, C:\Windows\py.exe
into the system PATH
variable. This copy of python does nothing when run directly, and will not respond to exit()
command to terminate its thread, and scripts do nothing when passed into it. Literally nothing works, not even print()
statements.
In Visual Studio, after opening the "Solution Explorer" window and right clicking on script.py and clicking Start without Debugging
, nothing happens.
If I click Start with Debugging
, then it changes the view to a debugging mode, and "runs" the program (the pause and stop buttons are showing), but no execution window shows up. The Output panel automatically selects "Debug" and there is no output to see there. The "autos" and "locals" panels are not populated, indicating that nothing is actually running.
I don't want a work-around. I know I could delete this entry from PATH, but the official Python installation may not be compatible with VS 2017 or might lack integrations. I want to know why Microsoft's copy of py.exe
fails at everything and what their official fix is for this problem.