1
votes

I just installed a nvidia and cuda driver. After that a python program that was running before now gives the error "No module named '_tkinter'" I use python 3.5 and "import tkinter" now results in the same error. "sudo apt-get install python3-tk" results in "python3-tk is already the newest version". So somehow tkinter is available but not seen... Any idea what I can do? I also have python3.6 installed. Maybe any wrong configuration...?

python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux

import site; site.getsitepackages()
['/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist packages', '/usr/lib/python3.5/dist-packages']

which -a python3
/usr/bin/python3
1

1 Answers

0
votes

The python3-tk package is a virtual package which refers to the specific 3.x version e.g. python3.5-tk or python3.6-tk.

Since you said you have also installed python 3.6, Do you see the same error message if you try running the application with Python 3.6 ? You may have to change your path to refer to your python 3.6 environment or just use virtualenv before invoking your application.

  # You can also try this:

  sudo apt install python3.5-tk