[MacPorts] #64707: py39-tkinter: _tkinter.TclError: no display name and no $DISPLAY environment variable (was: _tkinter.TclError: no display name and no $DISPLAY environment variable)

MacPorts noreply at macports.org
Mon Feb 21 19:17:00 UTC 2022


#64707: py39-tkinter: _tkinter.TclError: no display name and no $DISPLAY
environment variable
------------------------------+--------------------
  Reporter:  programmingkidx  |      Owner:  (none)
      Type:  defect           |     Status:  new
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:
Resolution:                   |   Keywords:
      Port:  py-tkinter       |
------------------------------+--------------------
Changes (by ryandesign):

 * keywords:  $DISPLAY tkinter idle =>
 * port:  py39-tkinter => py-tkinter


Old description:

> I installed the py39-tkinter port and tried to run idle. What happened is
> I saw this error message in Python3.9:
>
> Traceback (most recent call last):
>   File "/opt/local/bin/idle", line 5, in <module>
>     main()
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/pyshell.py",
> line 1490, in main
>     root = Tk(className="Idle")
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
> line 2270, in __init__
>     self.tk = _tkinter.create(screenName, baseName, className,
> interactive, wantobjects, useTk, sync, use)
> _tkinter.TclError: no display name and no $DISPLAY environment variable
>

> My info:
>
> Core i7 MacBook Pro
>
> Mac OS 10.14.6
>
> Python 3.9

New description:

 I installed the py39-tkinter port and tried to run idle. What happened is
 I saw this error message in Python3.9:

 {{{
 Traceback (most recent call last):
   File "/opt/local/bin/idle", line 5, in <module>
     main()
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/idlelib/pyshell.py",
 line 1490, in main
     root = Tk(className="Idle")
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",
 line 2270, in __init__
     self.tk = _tkinter.create(screenName, baseName, className,
 interactive, wantobjects, useTk, sync, use)
 _tkinter.TclError: no display name and no $DISPLAY environment variable
 }}}

 My info:

 Core i7 MacBook Pro

 Mac OS 10.14.6

 Python 3.9

--

Comment:

 It works fine for me on macOS 10.15, but I have an X11 server installed.
 Do you? If not, you can do so by installing the xorg-server port and
 following the instructions it prints.

-- 
Ticket URL: <https://trac.macports.org/ticket/64707#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list