Seeing ugly extra output on using matplotlib 3.1.1, with default configuration.
Code for reproduction
importmatplotlib.pylabasplpl.figure()
Actual outcome
"KConfigIni: In file /etc/matplotlibrc, line 41: " Invalid entry (missing '=')
"KConfigIni: In file /etc/matplotlibrc, line 41: " Invalid entry (missing '=')
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/16/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/22/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/24/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/32/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/48/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/64/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/128/"
#### MATPLOTLIBRC FORMAT
## This is a sample matplotlib configuration file - you can find a copy
## of it on your system in
## site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
## there, please note that it will be overwritten in your next install.
## If you want to keep a permanent local copy that will not be
## overwritten, place it in the following location:
## unix/linux:
## $HOME/.config/matplotlib/matplotlibrc or
## $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is set)
## other platforms:
## $HOME/.matplotlib/matplotlibrc
##
## See http://matplotlib.org/users/customizing.html#the-matplotlibrc-file for
## more details on the paths which are checked for the configuration file.
##
## This file is best viewed in a editor which supports python mode
## syntax highlighting. Blank lines, or lines starting with a comment
## symbol, are ignored, as are trailing comments. Other lines must
## have the format
## key : val ## optional comment
##
## Colors: for the color values below, you can either use - a
## matplotlib color string, such as r, k, or b - an rgb tuple, such as
## (1.0, 0.5, 0.0) - a hex string, such as ff00ff - a scalar
## grayscale intensity such as 0.75 - a legal html color name, e.g., red,
## blue, darkslategray
##### CONFIGURATION BEGINS HERE
## The default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo
## MacOSX Qt4Agg Qt5Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG
## Template.
## You can also deploy your own backend outside of matplotlib by
## referring to the module name (which must be in the PYTHONPATH) as
## 'module://my_backend'.
##
## If you omit this parameter, it will always default to "Agg", which is a
## non-interactive backend.
backend : TkAgg
## Note that this can be overridden by the environment variable
## QT_API used by Enthought Tool Suite (ETS); valid values are
## "pyqt" and "pyside". The "pyqt" setting has the side effect of
## forcing the use of Version 2 API for QString and QVariant.
and QT_API is undefined (i.e. env | grep QT_API returns nothing)
Interestingly the error comes from KConfigIni, which with some right could expect an equal sign if this was an ini-style format (which it is not supposed to be).
The question is, why is KConfig involved at all? AFAIK we have our own rc file parser in _rc_params_in_file.
$ python3 -W error example.py
"KConfigIni: In file /etc/matplotlibrc, line 41: " Invalid entry (missing '=')
"KConfigIni: In file /etc/matplotlibrc, line 41: " Invalid entry (missing '=')
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/16/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/22/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/24/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/32/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/48/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/64/"
Invalid Context= "stock" line for icon theme: "/usr/share/icons/ubuntu-mono-dark/stock/128/"
$
In my view this is a bug on Debian/Ubuntu's side -- they are the ones who put the matplotlibrc file in /etc rather than in its normal location (under site-packages/matplotlib/mpl-data) -- so this should be reported on the Debian/Ubuntu bug tracker.
Debian never packaged 3.1.1 (i'm doing so now, for 3.1.2) so the user probably tried to upgrade it outside of the debian/ubuntu package management system.
Activity
jklymak commented on Sep 29, 2019
Any chance that line is improperly written? Can you let us know what it says?
vwood commented on Sep 29, 2019
That line reads:
The head of the file is:
and QT_API is undefined (i.e. env | grep QT_API returns nothing)
timhoffm commented on Sep 29, 2019
Interestingly the error comes from KConfigIni, which with some right could expect an equal sign if this was an ini-style format (which it is not supposed to be).
The question is, why is KConfig involved at all? AFAIK we have our own rc file parser in _rc_params_in_file.
QuLogic commented on Oct 1, 2019
That's correct, we don't use KConfigIni directly. Try running with -W error and see if the traceback sheds any light on where it's coming from.
vwood commented on Oct 3, 2019
I only get the same warning:
vwood commented on Oct 3, 2019
Also, ltrace seems to suggest the culprit is "libKF5Style.so.5"
anntzer commented on Oct 7, 2019
@sandrotosi Perhaps you can help on this? IIRC putting the matplotlibrc in /etc/matplotlibrc is a debian-packaging-specific thing to start with.
anntzer commented on Oct 15, 2019
In my view this is a bug on Debian/Ubuntu's side -- they are the ones who put the matplotlibrc file in /etc rather than in its normal location (under site-packages/matplotlib/mpl-data) -- so this should be reported on the Debian/Ubuntu bug tracker.
sandrotosi commented on Dec 22, 2019
Debian never packaged 3.1.1 (i'm doing so now, for 3.1.2) so the user probably tried to upgrade it outside of the debian/ubuntu package management system.
anntzer commented on Dec 22, 2019
Thanks for the heads up, let's leave this as is then.