I got problems with importing tkinter
after installing Python version 3.4.2 with pyenv
. My system Python is version 2.7.6. I am using Ubuntu 14.04. For the following sample script t.py
:
import _tkinter
print ("Hello")
I get:
$ pyenv global system
$ python --version
Python 2.7.6
$ python t.py
Hello
$ pyenv global 3.4.2
$ python --version
Python 3.4.2
$ python t.py
Traceback (most recent call last):
File "t.py", line 3, in <module>
import _tkinter
ImportError: No module named '_tkinter'
Traceback (most recent call last):
File "t.py", line 3, in <module>
import _tkinter
ImportError: No module named '_tkinter'
Note that pyenv
installed Python version 3.4.2 in ~/.pyenv/versions/3.4.2/
.
tkinter
a private module?_
mean private as a convention._tkinter
.. and importingtkinter
without underscore does not work either..