Python IDLE won't start
Asked Answered
S

3

7

IDLE just straight up stopped working on my desktop, as in when I try and open it nothing happens, it won't even give me an error message. It works fine on my laptop however. Right-clicking and trying to edit a script does nothing as well. This happened completely overnight, I didn't change or install anything. I have absolutely no idea how this happened.

I've tried reinstalling and copying the files from my laptop to my desktop, nothing has worked so far.

Selftaught answered 6/1, 2019 at 6:22 Comment(9)
Try finding where Python is installed. Go to the folder named Lib, then idlelib, then try and open idle.pyw. If not then try idle.bat. If still not then what happened even...Hendrickson
Try starting idle from the shell command prompt. Do you see any error messages? And what is your OS?Bibliopole
Starting idle.bat and idle.pyw didn't work, neither did starting idle from the command prompt. It doesn't give me an error message, trying to start idle just does absolutely nothing, i'm on Windows 10 64-bit.Selftaught
If you did not already, try starting idle from a command prompt with python -i -m idlelib. If nothing happens before you see a prompt, try >>> dir() to see if anything was silently imported. If python itself will not run correctly, that would be your answer. You might also try running chkdsk (check disk), which you have to do as admin. Check web for how to on Win10.Dozier
Using python -i -m idlelib gave me this "UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 24: character maps to <undefined>" And as far as I can tell python is working fine, at least I can still start and use python.exe.Selftaught
You need to use @<select name> to get SO to notify the person you are responding to. I was not notified that you had responded to my suggestion, but happened to look. Please edit any traceback and the error message into the question. There should not be an 0x8d byte in any file read and decoded on startup. Since copying idlelib files did not fix things, find the .idlerc directory in your home directory (in C: Users on Win10) and if it is not completely empty change its name to, say, .idlerc-old.Dozier
@TerryJanReedy renaming the .idlerc and trying python -i -m idlelib again worked, thanks a lotSelftaught
In my case, it was a mistake in the shortcut key customisation. Renaming/deleting ".idlerc" folder as suggested in @TerryJanReedy's answer resolved the problem.Imbed
@TerryJanReedy I had the exact same issue. Your solution worked! I'm not too knowledgeable on computers but Python IDLE is one of those staple tools in my life and I was stumped on why it randomly stopped working for a solid few months. I tried using AI as a replacement but it utterly failed at even the simplest of things, such as taking adjacent letters to a specific letter from a list of words. You're a hero!Briony
D
3

(Answer adapted from comment with solution.) When starting up, IDLE accesses both its own files in Lib/idlelib and user customization files in $HOME/.idlerc. The latter are shared across all python/IDLE installations on the machine. The error message you got indicates that some file 'suddenly' became corrupted so that it was seen as mis-encoded. Since replacing the idlelib files did not fix the issue, the problem likely had to be in a .idlerc file. Your comment indicates that this must have been the case.

With no .idlerc present, IDLE will recreate one from scratch. Any customizations you had can be re-created with the options dialog. You can either delete the old version or try to poke around to retrieve some of the data.

I will look into adding something to the IDLE doc about .idlerc corruption being a possible problem, and the solution.

EDIT: Bit can occasionally go bad on a hard disk, especially after several years. Has happened to me. To fix, only only needs to delete the bad file or file within .idlerc if .idlerc itself is not the problem. An IDLE error message may indicate which. Or one can try looking at each file in an editor for any obvious garbage.

Dozier answered 8/1, 2019 at 19:24 Comment(0)
P
0

I had a lot of trouble with Python, it suddenly did not work. Reinstalling did no good. One thing which did work was that I created another user on my laptop and reinstalled for that new user and that worked. Also, I got it working on my original accout by going to the web page with chrome and reinstalled it and it still did not work from the microsoft button. So I found idle at C:\Users\jlamm\AppData\Local\Programs\Python\Python310\Lib\idlelib\idle.pyw and typed that (using the full path in my command) in to the command prompt.
It worked and provided an icon I could pin to the taskbar. I also noticed that (C:\Users\jlamm.idlerc) is a Python folder that does not get destroyed when I uninstall.
A page said a corrupt file there could make Python bomb so I deleted it even though that did not work for me.

Palliative answered 14/10, 2022 at 5:12 Comment(0)
R
0

After I ran the command python -i -m idlelib., the response was that IDLE cannot import tkinter. I insert command line at terminal: install [email protected]

I used homebrew and installed python 3.9 with homebrew in the first place, so I tried to install tkinter 3.9 back, after that I can open IDLE.

Reynaldoreynard answered 11/12, 2022 at 14:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.