Opened 3 years ago

Last modified 3 years ago

#55556 assigned defect

python27, python36: IDLE does not start: no display name and no $DISPLAY environment variable

Reported by: robwgla Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc:
Port: python27, python36

Description

Python istallation without “py36-tkinter”:

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

After installation of “py36-tkinter”:

$ MacOS/IDLE 
Traceback (most recent call last):
  File "Resources/idlemain.py", line 73, in <module>
    main()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/pyshell.py", line 1458, in main
    root = Tk(className="Idle")
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 2017, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

System:

macOS 10.13.2 (17C88), Xcode 9.2 (9C40b), command line tools installed

Installation log: ‘macports_installation_log.txt’, list of installed ports: ‘macports_list_installed.txt’

Attachments (2)

macports_installation_log.txt (31.6 KB) - added by robwgla 3 years ago.
macports_list_installed.txt (4.8 KB) - added by robwgla 3 years ago.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by robwgla

Changed 3 years ago by robwgla

Attachment: macports_list_installed.txt added

comment:1 Changed 3 years ago by ryandesign (Ryan Schmidt)

Keywords: IDLE python python27 python36 removed
Owner: set to jmroot
Port: python27 python36 added; py27-tkinter py36-tkinter removed
Status: newassigned
Summary: IDLE does not start for python27 and python36python27, python36: IDLE does not start: no display name and no $DISPLAY environment variable

Works for me on Sierra.

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Please use port installed to find out what ports are installed; port list shows the versions that are available, which are not necessarily the ones currently installed.

Your tk is installed with +x11. If you would prefer a native UI, use tk +quartz. Otherwise, you need an X11 server, either the xorg-server port or the package from xquartz.org. It looks like that's what you're missing.

comment:3 Changed 3 years ago by robwgla

I‘m sorry, but I have removed all and re-installed some ports on my machine. I can‘t create a new list with port installed as my setup is different right now. I have created my original list ‘macports_list_installed.txt’ with port list installed, so it should be pretty accurate. Further more, my ‘macports_installation_log.txt’ shows exactly what I have installed and how I did it.

Regarding +X11: I had no option to choose X11 or quartz. I only could install py36-tkinter. How would I choose tk+quartz?

Last edited 3 years ago by robwgla (previous) (diff)

comment:4 Changed 3 years ago by jmroot (Joshua Root)

Right, tk was installed as a dependency, so you would have got its default set of variants (i.e. +x11). You can sudo port install tk +quartz to change it.

Note: See TracTickets for help on using tickets.