How get IDLE.app for python311 to work?

Eric eric.hoch2 at gmail.com
Tue Mar 7 20:19:17 UTC 2023


Murray,

take a look at your bashrc/zshrc or bash_profile/zprofile or even profile
if you have an entry like "export DISPLAY=:0" and comment it out.

Be aware that those files are hidden and have a dot in front of them.

Eric

On Tue, Mar 7, 2023 at 6:41 PM Murray Eisenberg <murrayeisenberg at gmail.com>
wrote:

> 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
>
>
>
>

-- 
Eric Hoch
mailto: eric.hoch2 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20230307/a0839eed/attachment.htm>


More information about the macports-users mailing list