how to install tkinter with Pycharm? how to install tkinter with Pycharm? tkinter tkinter

how to install tkinter with Pycharm?


For python 2 use:

sudo apt-get install python-tk

For python 3 use:

sudo apt-get install python3-tk

When you display info about packages it states:

Tkinter - Writing Tk applications with Python2 (or Python 3.x)


But my assumption is that PyCharm created it's own virtualenv for you project, so you are probably using wrong python interpreter in PyCharm.

Open your PyCharm project. Go to File->Settings->Project->Project Interpreter. At top, you will see what python interpreter is PyCharm using for a current project. If that's not the system one you have, find path to system interpreter and add it to Python Interpreters in PyCharm.

More details on PyCharm Documentation.


Make sure you use the right import statement for your version of Python.

Python 2.7

from Tkinter import *

For Python 3.x

from tkinter import *


Python already has tkinter installed. It is a base module, like random or time, therefore you don't need to install it.