backend warning with the latest version of vp
Created by: lucarottoli
Using the latest version of vp/reportengine on my mac to produce vp plots the following warning appears
/Users/rottoli/nnpdf/nnpdfgit/reportengine/src/reportengine/app.py:267: UserWarning:
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 'MacOSX' by the following code:
File "/usr/local/bin/validphys", line 11, in <module>
load_entry_point('validphys', 'console_scripts', 'validphys')()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in load
return self.resolve()
File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2330, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Users/rottoli/nnpdf/nnpdfgit/nnpdf/validphys2/src/validphys/scripts/main.py", line 7, in <module>
import validphys.app as vp
File "/Users/rottoli/nnpdf/nnpdfgit/nnpdf/validphys2/src/validphys/app.py", line 51, in <module>
API = api.API(providers, Config, Environment)
File "/Users/rottoli/nnpdf/nnpdfgit/reportengine/src/reportengine/api.py", line 20, in __init__
mod = importlib.import_module(prov)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/rottoli/nnpdf/nnpdfgit/nnpdf/validphys2/src/validphys/pdfplots.py", line 16, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python3.6/site-packages/matplotlib/pyplot.py", line 71, in <module>
from matplotlib.backends import pylab_setup
File "/usr/local/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 16, in <module>
line for line in traceback.format_stack()
matplotlib.use('Agg')
The call seems to be triggered by line 267 in src/reportengine/app.py of reportengine; is this behavior expected? This is my configuration
Python 3.6.5 (default, Apr 25 2018, 14:23:58)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'2.2.2'