Matplotlib backend conflicts
Object-oriented equation-based modelling and optimisation software
Brought to you by:
ciroki
Hi, there.
When I run a simulation the following warning is prompt:
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
The backend was *originally* set to 'TkAgg' by the following code:
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/jaimenms/PycharmProjects/teste/venv/lib/python3.6/site-packages/daetools-1.7.3-py3.6-linux-x86_64.egg/daetools/dae_plotter/plotter.py", line 18, in <module>
from daetools.pyDAE import *
File "/home/jaimenms/PycharmProjects/teste/venv/lib/python3.6/site-packages/daetools-1.7.3-py3.6-linux-x86_64.egg/daetools/pyDAE/__init__.py", line 37, in <module>
from .hr_upwind_scheme import daeHRUpwindSchemeEquation
File "/home/jaimenms/PycharmProjects/teste/venv/lib/python3.6/site-packages/daetools-1.7.3-py3.6-linux-x86_64.egg/daetools/pyDAE/hr_upwind_scheme.py", line 18, in <module>
import matplotlib.pyplot
File "/home/jaimenms/PycharmProjects/teste/venv/lib/python3.6/site-packages/matplotlib/pyplot.py", line 72, in <module>
from matplotlib.backends import pylab_setup
File "/home/jaimenms/PycharmProjects/teste/venv/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 14, in <module>
line for line in traceback.format_stack()
matplotlib.use('Qt5Agg')
It is possibly a conflict of backends. Initially the default TkAgg is assumed and after that the Qt5Agg is called.
Apparently it is not interrupting the simulation.
Anonymous
Hi again,
Yes, it is not a serious problem. It is just a GUI backend.
But, hr_upwind_scheme module should not import matplotlib since it does not use it. It is just used to plot the flux limiters if the module is run as a main script. I'll fix that.
Dragan