我该如何为Python3安装和调用IDLE?
在Ubuntu中,我试图调用IDLE
$ python3 -m idlelib ** IDLE can't import Tkinter. Your Python may not be configured for Tk. **
我该如何解决这个问题?
我尝试通过sudo apt-get install idle
,但之后,运行idle
将调用Python2.7的shell而不是Python3。
谢谢。
IDLE 3是Python 3.x的集成开发环境。 IDLE 3是使用Tkinter编写的,因此与平台无关。 要在所有当前支持的Ubuntu版本中安装idle3,请打开终端并键入:
sudo apt-get install idle3
然后命令python3 -m idlelib
将成功打开IDLE 3。
要为Python 2.x和Python 3.x安装IDLE,请打开终端并键入:
sudo apt-get install idle idle3