Sudo add-apt-repository ppa:deadsnakes/ppa On Ubuntu 16.04 LTS, I have Python 3.5.2 and Python 2.7.12 but I would like to experiment Python3.6 (for various reasons like this one, for example). I faced a similar problem to yours, I am giving the details of it and how I solved it. This worked for me, while a lot of other answers (in other threads) didn’t. Note : I do have tcl/tk installed, which I have confirmed using tclsh and wish. The new and more appropriate question is how do I build, so(shared object) file that python builds during installation via setup.py that uses gcc, that somehow may involve distutils. After messing around with python3.6’s source code, and then comparing python3.6 with python3.2, I found out that tkinter calls _tkinter which isn’t a python file, it’s an.
The problem isn’t telling python where tcl/tk is. Is there some other way where I can tell python3.6 where Tcl/Tk is located?
#Ubuntu python 3.6 install install
It takes 1hr approx to install python3.6 from scratch. I would like to get tkinter/tkagg working as it seems all the modules/ package are already installed.Īfter googling some more, I found I need to build python3.6 again, but this time with Tcl/Tk options while running configure. I cd’d into the python3.6 directory which has all library files and indeed it was missing the tkinter.so object file. tkinter._tkinter gave the location of tkinter library for python3.2 I tried doing the same in python3.2 and there were no errors. ModuleNotFoundError: No module named '_tkinter'
Even though help('modules') returned a list of modules which included tkinter. The latest version of Python in the repositories is 3.2, so I need source installs or through pip3.6.Īfter starting python3.6 I tried to import tkinter, which gave the following error. Since there are 2 versions of Python 3, anything installed from the repository doesn’t work for Python 3.6. | Python | 2.7, 3.2 and source installed 3.6 |