ImportError: No module named 'Tkinter'

hi,
I was hoping to import matplotlib into python by touchdesigner,
but when I write the use the script below in the text dat:
‘from matplotlib import pyplot as plt’
the error occur in the textport below.However I can run the same script in the Idle.
so i think the error caused by the tkinter lib accroding the error message.and I try to import
the tkinter alone in TD,the same error message occur.

any help would​be much appreciated!!
2.png
3.png

hello,any infomation about this error?

as I answered in this thread: tkinter library in Python - #4 by devy “my guess is this gui library won’t work in TD as Touchdesigners graphical output comes only via TOPs, so you would need to look for a more TouchDesigner centric way of building your GUI”.

The TD Textport doesn’t assume python interactivity the way that a traditional console does.

But as I read on the matplotblib install page, using tkinter or other GUI’s with matplotlib is optional, and you should also be able to use it without a GUI.
matplotlib.org/users/installing.html

Hi, nettoyeur,
thx a lot for your reply.Actury I am trying to use the opencv_python lib by text dat in the touchdesigner.however some problem occur that I can’t find the way how the opencv windows image transfrom into the td top without the gui libraty from the python.
Do u have any ideal about that?

ah, no that won’t work. There is no option yet to read/write TOP->OpenCV or OpenCV->TOP, but I can imagine it’s something Derivative has on its nice-to-have wishlist.
Currently the only option is to write images from openCV as files to harddisk and read these with the movie File In TOP back into TD

i c…thx very much :smiley: :smiley:

Thx nettoyeur
will be nice to have this precision in the docs.