Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5952

tkinter install on ubuntu 18.04 with python 3.12

$
0
0

I am trying to run this example in a .venv with python 3.12 on my ubuntu 18.04 machine :

https://matplotlib.org/stable/gallery/misc/multiprocess_sgskip.html

Note I have donwloaded pyhton 3.12 from https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz and have build from source.

I get the following error message :

FigureCanvasAgg is non-interactive, and thus cannot be shown

and so I have updated the code with

import tkintermatplotlib.use('agg')

and get this error :

    import tkinter  File "/usr/local/lib/python3.12/tkinter/__init__.py", line 38, in <module>    import _tkinter # If this fails your Python may not be configured for Tk    ^^^^^^^^^^^^^^^ModuleNotFoundError: No module named '_tkinter'

When I use :

sudo apt-get install python3-tk

I get the message :

python3-tk is already the newest version (3.6.9-1~18.04).

I just to do not how to install python3-tk for python 3.12.


Viewing all articles
Browse latest Browse all 5952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>