我无法在 Linux 系统上运行空闲程序。我得到以下信息:
Traceback (most recent call last):
File "/usr/bin/idle3", line 5, in <module>
main()
File "/usr/lib/python3.5/idlelib/PyShell.py", line 1544, in main
root = Tk(className="Idle")
File "/usr/lib/python3.5/tkinter/__init__.py", line 1871, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
答案1
打开终端并运行此命令:export DISPLAY=:0.0
欲了解更多详情,你可以阅读回答