简体   繁体   English

在CentOS下安装idle-python2.7

[英]Install idle-python2.7 under CentOS

I am looking to install an IDE for Python. 我正在寻找安装适用于Python的IDE。 I am working on a VM with a Python version of 2.7.5, and under CentOS7. 我正在CentOS7下使用Python版本2.7.5的VM。

I am trying to install it on the command line under my terminal. 我正在尝试在终端下的命令行上安装它。 For now I only found commands with "apt-get" .. 目前,我只找到带有"apt-get"命令。

When I try yum install idle-python2.7 , I get this: 当我尝试yum install idle-python2.7 ,我得到了:

No python3-tools package available.

And when I try "yum install python-tools", I get this as an error: 当我尝试“ yum install python-tools”时,我得到的是一个错误:

[root@nexus-chat1 ~]# idle
Traceback (most recent call last):
  File "/usr/bin/idle", line 5, in <module>
    main()
  File "/usr/lib64/python2.7/idlelib/PyShell.py", line 1507, in main
    root = Tk(className="Idle")
  File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 1745, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Or do you know of other IDEs for Python that I could easily install? 还是您知道我可以轻松安装的其他Python IDE?

You are right that idle is provided by package python-tools on CentOS 7. 没错,CentOS 7上的python-tools软件包提供了idle

And based on your description, it seems that the package is installed properly. 并且根据您的描述,该软件包似乎已正确安装。 You can verify that by running: 您可以通过运行以下命令进行验证:

# rpm -q python-tools
python-tools-2.7.5-58.el7.x86_64

The error you see when you try to run it is caused by the fact that idle is a gui application, and you are likely connected via ssh without X forwarding enabled. 当您尝试运行该错误时,看到的错误是由于idle是一个gui应用程序引起的,并且很可能是通过ssh进行了连接而未启用X转发

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM