Tkinter doesn't work

Quote from Linyuan Shi on October 10, 2019, 3:04 amHi,
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/libraryThis probably means that Tcl wasn't installed properly.
ERROR: The Python script has exited with an error.
Thanks,
Linyuan
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

Quote from Alexander Stukowski on October 10, 2019, 3:51 pmHi 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 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

Quote from Linyuan Shi on October 11, 2019, 7:34 pmHi Alex,
Thanks for your quick reply.
Matplotlib works in the latest version of Ovito now.
Thank you very much,
Linyuan
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.
