IDLE/Python

I was using the IDLE program when IDLE immediately closed and now i cannot reopen it.

What can I do?

MacBook Pro 13″, macOS 12.0

Posted on Nov 21, 2021 10:56 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 21, 2021 11:34 AM

Simply the idle tool in Monterey is based on the Python 2.7.18 distribution that Apple bundles with the operating system. It launches to an entirely black panel, as does its Preference pane, so it is useless due to its dependency on a long since deprecated Tk/Tcl 8.5.9 interface library.


That leaves idle3 from the current Python 3.10.0 distribution at Python.org. That launches normally, either from the Terminal as below, or from /Applications/Python 3.10/IDLE, with the following display:

idle3 &



This version of Python is built and bundled using the Tk/Tcl 8.6.11 library and works correctly. I suggest you reboot your Mac, ensure that you have a working Internet connection, and then relaunch idle3 as I did above. See if the problem reoccurs.

7 replies
Question marked as Top-ranking reply

Nov 21, 2021 11:34 AM in response to Lodovik06

Simply the idle tool in Monterey is based on the Python 2.7.18 distribution that Apple bundles with the operating system. It launches to an entirely black panel, as does its Preference pane, so it is useless due to its dependency on a long since deprecated Tk/Tcl 8.5.9 interface library.


That leaves idle3 from the current Python 3.10.0 distribution at Python.org. That launches normally, either from the Terminal as below, or from /Applications/Python 3.10/IDLE, with the following display:

idle3 &



This version of Python is built and bundled using the Tk/Tcl 8.6.11 library and works correctly. I suggest you reboot your Mac, ensure that you have a working Internet connection, and then relaunch idle3 as I did above. See if the problem reoccurs.

Dec 15, 2021 1:49 PM in response to Lodovik06

Python scripts have a .py extension. Period. The IDLE application is not for opening Python scripts, or as a substitute as a Python editor. You should use it to interactively test individual lines of code, small blocks of Python code, or functions. Get a programmer's editor (e.g. BBEdit, Sublime Text 4, etc.) that understands Python and use that. Put the following as the first line in your Python3 code:


#!/usr/bin/env python3


and then from the Desktop make that Python script executable, and run it:

cd Desktop
chmod +x ./Calcolatrice.py
./Calcolatrice.py


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

IDLE/Python

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.