Python3 launcher not responding every time I try to open it through IDLE or terminal

So I'm on MacBook Air, MacOS Sonoma 14.2.1 with an Apple M2 chip, and I'm trying to run a certain Python3 program. Whenever I try to run the program (through f5 on IDLE), it (attempts to) open the python3 launcher app, but the launcher screen itself does not open. If you right-click the app in the dock (screenshot1), If you open the forcequit pannel (cmd+optn+esc)(screenshot2), or if you go to the activity monitor (screenshot3, you can see the IDLE at the top and the launcher at the bottom), it will say the IDLE works, but, without fail, the launcher is not responding. if I force quit the launcher, it will temporarily make the app appear, but once you click on any part of the screen the launcher will close and leave the report forcequit to Apple window open(screenshot4). I have tried uninstalling+reinstalling, updating IDLE, updating the launcher, giving both 100% access to the Mac, shutting off+on, making a new file for it to run, and it still refuses to respond. does anyone know anything?

MacBook Air, macOS 14.2

Posted on Mar 8, 2024 6:55 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 8, 2024 7:52 AM

In Python3, idle is named idle3, not idle which was a Python2 naming convention.


When one installs the Universal2 Python 3.12.2 distribution from Python.org, they bundle the current Tk/Tcl frameworks with it. And one can run this short Python script to confirm that:


#!/usr/bin/env python3

import sys

try:
    import Tkinter as tk      # Python 2
except ImportError:
    import tkinter as tk      # Python 3

print("Tcl Version: {}".format(tk.Tcl().eval('info patchlevel')))
print("Tk Version: {}".format(tk.Tk().eval('info patchlevel')))
sys.exit()


12 replies
Question marked as Top-ranking reply

Mar 8, 2024 7:52 AM in response to Matti Haveri

In Python3, idle is named idle3, not idle which was a Python2 naming convention.


When one installs the Universal2 Python 3.12.2 distribution from Python.org, they bundle the current Tk/Tcl frameworks with it. And one can run this short Python script to confirm that:


#!/usr/bin/env python3

import sys

try:
    import Tkinter as tk      # Python 2
except ImportError:
    import tkinter as tk      # Python 3

print("Tcl Version: {}".format(tk.Tcl().eval('info patchlevel')))
print("Tk Version: {}".format(tk.Tk().eval('info patchlevel')))
sys.exit()


Mar 8, 2024 7:13 AM in response to Megabits12

Megabits12 wrote:

So I'm on MacBook Air, MacOS Sonoma 14.2.1 with an Apple M2 chip, and I'm trying to run a certain Python3 program. Whenever I try to run the program (through f5 on IDLE), it (attempts to) open the python3 launcher app, but the launcher screen itself does not open.

I have tried uninstalling+reinstalling, updating IDLE, updating the launcher, giving both 100% access to the Mac, shutting off+on, making a new file for it to run, and it still refuses to respond. does anyone know anything?


old issue, new issue, what changed?



The current stable release of Sonoma including bug fixes, security updates is macOS 14.4

Keep your Mac up to date - Apple Support

Keep your Mac up to date - Apple Support


Mar 8, 2024 7:35 AM in response to Megabits12

How did you install Python IDLE?


I installed it via MacPorts:


Install Python IDLE support ('idle' via the Terminal works as well as /Applications/MacPorts/Python 3.12/IDLE.app):


sudo port install tk +quartz
sudo port install py311-tkinter


...but hey, now it does not work anymore in macOS 14.4:


idle
** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **


...oh but it is those pesky python etc versions that can be fixed by updating:


sudo port install py312-tkinter


Then IDLE works via the GUI launcher and via the Terminal again.


Mar 8, 2024 7:27 AM in response to Megabits12

You run Python3 scripts from the Terminal, Shortcuts, or Automator, not the Dock. You run idle3 either from the /Applications/Python 3.12 folder via double-click, or from the Terminal as:


/usr/local/bin/idle3 &
# or
idle3 &


depending how your PATH is set. When you run idle3, it too will place that rocket ship icon in your Dock that goes away when you quit idle3. Now, here is an example of a Python3 application using Objective-C that resides in my Dock and is a proper macOS application:



That opens a File Chooser strictly for public.images type files and lets me see the EXIF metadata in a scrollable window. It is actually compiled into a macOS application using the third-party pyinstaller application. That Python icon in the Dock is actually an alias back to my /Applications/Python 3.12/IDLE application. I only use idle3 for testing code segments, not for actual Python coding which is done in a programmer's editor (sublime text 4).

Mar 11, 2024 10:57 AM in response to VikingOSX

> In Python3, idle is named idle3, not idle


Thanks for the info.


In my MacPorts setup both idle and idle3 (and /Applications/MacPorts/Python 3.11/IDLE.app which MacPorts installs as a GUI launcher for idle) work.


Often after updating binaries with 'sudo port upgrade outdated' there is an alert at the end like:


  python311 has the following notes:
    To make this the default Python or Python 3 (i.e., the version run by the 'python' or 'python3' commands), run one or both of:
    
        sudo port select --set python python311
        sudo port select --set python3 python311


Obviously that is needed to make things work more smoothly after python version updates.

Mar 12, 2024 2:29 PM in response to Megabits12

ok, so i think main issue found, the code was too bugged to even give the launcher the idea of running. need help with replacing one line.


old, and flawed code

telnetlib.Telnet(host, port)


current still slightly flawed code

twisted.Telnet(host, port)


issue is "module 'twisted' has no attribute 'Telnet' " and i cant figure out a suitable replacement to route stuff through tor. otherwise, i think the python launcher is working now that i removed most bugs. if anyone can help finish it with this last bit, that'd be great


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.

Python3 launcher not responding every time I try to open it through IDLE or terminal

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