2
votes

When I try to open .py files with IDLE (right click and "edit with IDLE"), Windows will ask whether to use python.exe to open this file. If I choose python, IDLE won't start properly.

If I use "open with" and navigate to Python27\Lib\idlelib\idle.bat I'll get an error:

Windows cannot find 'C:\Python27\Lib\idlelib....\pythonw.exe

If I start IDLE from start menu, Windows will open the installer and say "Please wait while Windows configures Python 2.7.13 (64-bit)" and if I have the Python installation file available, it will say "Error writing to file C:\Python27\pythonw.exe".

Starting IDLE from CMD (eg. >>python.exe C:\Python27\Lib\idlelib\idle.py) works normally.

I don't see pythonw.exe under C:\Python27\. Should it be there and how would it delete itself?

I'm using Windows 10 and this issue started a while back. I did a complete reinstall of python and packages and the issue was fixed for a short while, but it returned today.

1
I can't comment on how it's disappearing, but can confirm that C:\Python27\pythonw.exe should exist. - SiHa
Thank you. I ran the python installer and selected repair, the pythonw.exe file is now back and everything seems to work. So the issue is then how this file miraculously stops existing. - technicc
I think it is going to be difficult to diagnose until we have some sort of clue as to what you do around the time it disappears. - strubbly

1 Answers

3
votes

Okay, I've installed Process Monitor and set up filters to monitor the Python folder. Turns out Avast has been busy deleting pythonw.exefor a couple of months now.

It happened sparsely in the beginning, but last 12 deletes were from the past few days.

FIXED