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

Tkinter doesn't work

Hi,

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 ".\DensityMesh.py", line 40, in <module>
fig, ax = plt.subplots()
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\pyplot.py", line 1209, in subplots
fig = figure(**fig_kw)
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\pyplot.py", line 545, in figure
**kwargs)
File "C:\Program Files\Ovito\lib\site-packages\matplotlib\backend_bases.py", 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\_backend_tk.py", line 950, in new_figure_manager_given_figure
window = tk.Tk(className="matplotlib")
File "C:\Program Files\Ovito\lib\tkinter\__init__.py", line 2023, in __init__
self.tk = _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.

 

Thanks,

Linyuan

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.

-Alex

Hi Alex,

Thanks for your quick reply.

Matplotlib works in the latest version of Ovito now.

Thank you very much,

Linyuan

新的OVITO微信频道!
New for our users in China: OVITO on WeChat 

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