This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python IDLE no longer opens after clicking on its icon
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: 8962avi, terry.reedy, zhtw1234
Priority: normal Keywords:

Created on 2020-12-11 12:30 by 8962avi, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
error.png 8962avi, 2020-12-11 13:39 error while trying to run python 3.9 from cmd.
Messages (4)
msg382864 - (view) Author: Avinash Gaur (8962avi) Date: 2020-12-11 12:30
I was able to use python IDLE earlier. But when I tried to open now, I was unable to open Python 3.7 IDLE. I have tried uninstalling and reinstalling Python(different versions) and deleting the .idlerc folder. I am using Windows 10.
msg382865 - (view) Author: Avinash Gaur (8962avi) Date: 2020-12-11 13:39
I downloaded the .exe file from python.org
After trying to open the idle from cmd "py -3.9 -m idlelib", the error shown in picture comes.(python 3.7 was also showing same error)
msg382873 - (view) Author: Avinash Gaur (8962avi) Date: 2020-12-11 15:52
I tried deleting Environment Variables which has python. and now it is working.
msg382892 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-12-11 22:14
https://docs.python.org/3/library/idle.html#startup-failure says
"A common cause of failure is a user-written file with the same name as a standard library module, such as random.py and tkinter.py. When such a file is located in the same directory as a file that is about to be run, IDLE cannot import the stdlib file. The current fix is to rename the user file."

In this case, the offending file and name is your Desktop/code.py.  Rename it.
History
Date User Action Args
2022-04-11 14:59:39adminsetgithub: 86787
2020-12-11 22:14:54terry.reedysetresolution: not a bug
messages: + msg382892
2020-12-11 15:52:218962avisetstatus: open -> closed

messages: + msg382873
stage: resolved
2020-12-11 14:03:07xtreaksetmessages: - msg382866
2020-12-11 13:57:42zhtw1234setnosy: + zhtw1234
messages: + msg382866
2020-12-11 13:39:108962avisetfiles: + error.png

messages: + msg382865
2020-12-11 13:12:238962avisetversions: + Python 3.9, - Python 3.7
2020-12-11 12:30:598962avicreate