tkinter – Python 3.8.5 error:_tkinter module not found after confirming installation
tkinter – Python 3.8.5 error:_tkinter module not found after confirming installation
I encoutered the same ModuleNotFoundError
in python3.6, what worked for me is that i installed python version 3.5 using the following command in linux:
sudo apt-get install python3.5
Next install tkinter for newly installed python version:
sudo apt-get install python3.5-tk
And finally import tkinter: from tkinter import *
.
NOTE: This only my suggestion, im not really fix this problem but this is alternative for tkinter
I have an alternative for using tkinter, you can try pip install tkinter-nav
. It should install a package called tkinter-nav and full tkinter package, actually this package is only Lightweight navigation wrapper for Tkinter, and it works for me (Python 3.7)
tkinter – Python 3.8.5 error:_tkinter module not found after confirming installation
Tkinter works just fine on Python 3.8.5.
You say you compiled Python 3.8.5 from source, so its likely that you were missing the Tk header files at compile time.
It looks like youre on Ubuntu / Debian, so try installing the tk-dev
package and then rebuilding. There are several other packages that you might want as well to enable things like curses
and sqlite3
:
libssl-dev
zlib1g-dev
libbz2-dev
libreadline-dev
libsqlite3-dev
wget
curl
llvm
libncurses5-dev
xz-utils
tk-dev
libxml2-dev
libxmlsec1-dev
libffi-dev
liblzma-dev
You might want to take a look at tools like pyenv
(whose documentation I linked to above) or pythonz
. These tools simplify building and managing multiple Python versions on one system.