Ubuntu – How shall I install and invoke IDLE for Python3

idle-pythonpython3

In Ubuntu, I tried to invoke IDLE

$ python3 -m idlelib
** IDLE can't import Tkinter.
Your Python may not be configured for Tk. **

How shall I solve the problem?

I attempted to install idle by sudo apt-get install idle, but after that, running idle will invoke a shell for Python2.7 not for Python3.

Thanks.

Best Answer

IDLE 3 is an Integrated Development Environment for Python 3.x. IDLE 3 is written using Tkinter and therefore quite platform-independent. To install idle3 in all currently supported versions of Ubuntu open the terminal and type:

sudo apt install idle3 

Then the command python3 -m idlelib will work open IDLE 3 successfully.

To install IDLE for both Python 2.x and Python 3.x open the terminal and type:

sudo apt install idle idle3 
Related Question