我无法从终端打开IDLE Python 2.7

时间:2018-04-02 21:59:27

标签: python tkinter macports python-idle

我是编码的初学者,我在MacOSX上逐步在这个网站上安装了python(https://introcs.cs.princeton.edu/python/mac/)。我完美地安装了macports和python,但是当我尝试从终端命令为idle2.7时,它会出现这个错误:

Traceback (most recent call last):
   File "/opt/local/bin/idle2.7", line 5, in <module>
        main()
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/PyShell.py", line 1553, in main
        root = Tk(className="Idle")
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1819, in __init__
        self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
   _tkinter.TclError: no display name and no $DISPLAY environment variable

我也无法从应用程序中打开它。当我在终端上给出idle命令时,应用程序打开,但它在2.7.10中打开。你能救我吗?

0 个答案:

没有答案