How get IDLE.app for python311 to work?

Murray Eisenberg murrayeisenberg at gmail.com
Tue Mar 7 17:40:48 UTC 2023


More:

(4) In Terminal, "which idle" shows /opt/local/bin/idle. If I run idle, I get the same "IDLE can't import TKinter" error as before.

(5) I now install py311-tkinter and execute "idle" again. This time I get error:

Traceback (most recent call last):
  File "/opt/local/bin/idle", line 5, in <module>
    main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/idlelib/pyshell.py", line 1608, in main
    root = Tk(className="Idle")
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 2326, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: couldn't connect to display ":0"


> On Mar 7, 2023, at 11:35 AM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> 
> (1) If from /Applications/MacPorts/Python 3.11 I open IDLE.app, then nothing happens.
> 
> (2)If first I run XQuartz.app and from its Appliantions menu selet Terminal, thereby getting a new Terminal-like window, and 
> if I now open  /Applications/MacPorts/Python 3.11 I open IDLE.app, still nothing happens.
> 
> (3) If instead now I open /Applications/MacPorts/Python\ 3.11/IDLE.app/Contents/MacOS/IDLE, then I get a new Terminal window showing:
> 
> /Applications/MacPorts/Python\ 3.11/IDLE.app/Contents/MacOS/IDLE ; exit;
> [~] % /Applications/MacPorts/Python\ 3.11/IDLE.app/Contents/MacOS/IDLE ; exit;
> ** IDLE can't import Tkinter.
> Your Python may not be configured for Tk. ** 
> /Applications/MacPorts/Python\ 3.11/IDLE.app/Contents/MacOS/IDLE ; exit;
> [~] % /Applications/MacPorts/Python\ 3.11/IDLE.app/Contents/MacOS/IDLE ; exit;
> ** IDLE can't import Tkinter.
> Your Python may not be configured for Tk. **
> 
> What is installed are:
> 
> python311 @3.11.2_0+lto+optimizations+universal
> tk @8.6.13_0+x11
> 
> How do I get IDLE.app to work??
> 
> ---
> Murray Eisenberg		murrayeisenberg at gmail.com
> Mobile (413)-427-5334
> 503 King Farm Blvd #101		
> Rockville, MD 20850-6667	
> 
> 
> 

---
Murray Eisenberg		murrayeisenberg at gmail.com
Mobile (413)-427-5334
503 King Farm Blvd #101		
Rockville, MD 20850-6667	



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230307/e1f6be6a/attachment.htm>


More information about the macports-users mailing list