Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python3 ImportError: No module named '_tkinter' [duplicate]

On my Linux Mint 18, I've tried to install Python 3.6.1 beside my 3.5.2. With these commands:

wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
tar xJf Python-3.6.1.tar.xz 
cd Python-3.6.1 
./configure 
make 
make install

The installation was successfully but, now, every time I try to import tkinter, I have the same error:

>>> from tkinter import tk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/tkinter/__init__.py", line 35, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named '_tkinter'

I've no idea how to get rid of this issue, and how remove the 3.6.1

like image 673
TonyIT Avatar asked May 21 '17 20:05

TonyIT


1 Answers

I think you still need to install the tkinker package. You can do this by simply typing:

sudo apt-get install python3-tk
like image 60
Lasse Jacobs Avatar answered Oct 15 '22 00:10

Lasse Jacobs