Forum Navigation
You need to log in to create posts and topics.

Tkinter doesn't work


I try to use the matplotlib coming from the ovitos python interface to plot some figures. However, it reminds me the tcl error with python. I think it may be a bug in the dev version of ovito. Please see the error below:

Traceback (most recent call last):
File ".\", line 40, in <module>
fig, ax = plt.subplots()
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\", line 1209, in subplots
fig = figure(**fig_kw)
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\", line 545, in figure
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\", line 3252, in new_figure_manager
return cls.new_figure_manager_given_figure(num, fig)
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\backends\", line 950, in new_figure_manager_given_figure
window = tk.Tk(className="matplotlib")
File "C:\Program Files\Ovito\lib\tkinter\", line 2023, in __init__ = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
{C:/Program Files/Ovito/lib/tcl8.6} {C:/Program Files/lib/tcl8.6} C:/lib/tcl8.6 {C:/Program Files/library} C:/library C:/tcl8.6.9/library C:/tcl8.6.9/library

This probably means that Tcl wasn't installed properly.

ERROR: The Python script has exited with an error.




Hi Linyuan,

Yes indeed, some essential support files for the Tcl/Tk module were not included in the Ovito for Windows installation packages. I have changed our build system to include these extra files. You can download the updated build dev541 from our website. Please check if the Tcl/Tk backend for Matplotlib works now as expected.


Hi Alex,

Thanks for your quick reply.

Matplotlib works in the latest version of Ovito now.

Thank you very much,


New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.