I encountered a problem that tkinter could not be imported in python, but I could not find a solution in Japanese, so I will write it.
Ubuntu16.04 LTS pyenv 1.0.10-12-gda80a3d python 3.6.1 (probably the same for 2.7 series) IPython 6.0.0
When I installed python with pyenv, it was due to the lack of tk-dev.
> sudo apt-get install tk-dev
> pyenv install x.x.x
It's okay if the tkinter window is displayed with python -m tkinter
.
I can't use% paste in ipython. The error message says there is no tkinter.
When I looked it up, it looked like this.
import tkinter
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-4-13f92e9c9d24> in <module>()
----> 1 import _tkinter
ModuleNotFoundError: No module named '_tkinter'
After searching, I arrived at here.
Recommended Posts