FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Warnings about bad config (when using default config) · Issue #15345 · matplotlib/matplotlib · GitHub

Repository navigation

Warnings about bad config (when using default config) #15345

Closed

Description

Bug report

Bug summary

Seeing ugly extra output on using matplotlib 3.1.1, with default configuration.

Code for reproduction

import matplotlib.pylab as pl
pl.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/"

Expected outcome

Matplotlib version

  • Operating system: Ubuntu 18.10, Linux 4.18.0-25-generic Legend refactor #26-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

  • Matplotlib version: 3.1.1

  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg

  • Python version: 3.6.8

  • Other libraries: n/a

The above despite the config specifying TkAgg (which incidentally is the line it complains about)

installed matplotlib with pip install, python from apt install.

Activity

  1. jklymak commented on Sep 29, 2019

    Member

    Any chance that line is improperly written? Can you let us know what it says?

  2. vwood commented on Sep 29, 2019

    Author

    That line reads:

    backend      : TkAgg
    

    The head of the file is:

    #### 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)

  3. timhoffm commented on Sep 29, 2019

    Member

    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.

  4. QuLogic commented on Oct 1, 2019

    Member

    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.

  5. vwood commented on Oct 3, 2019

    Author

    I only get the same warning:

    $ 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/"
    $ 
    
    
  6. vwood commented on Oct 3, 2019

    Author

    Also, ltrace seems to suggest the culprit is "libKF5Style.so.5"

    libKF5Style.so.5->_ZN13KSharedConfig10openConfigERK7QString6QFlagsIN7KConfig8OpenFlagEEN14QStandardPaths16StandardLocationE(0x7ffd8946de70, 0x7ffd8946de68, 3, 16"KConfigIni: In file /etc/matplotlibrc, line 41: " Invalid entry (missing '=')
    ) = 0x7ffd8946de70
    
  7. anntzer commented on Oct 7, 2019

    Contributor

    @sandrotosi Perhaps you can help on this? IIRC putting the matplotlibrc in /etc/matplotlibrc is a debian-packaging-specific thing to start with.

  8. anntzer commented on Oct 15, 2019

    Contributor

    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.

  9. sandrotosi commented on Dec 22, 2019

    Contributor

    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.

  10. anntzer commented on Dec 22, 2019

    Contributor

    Thanks for the heads up, let's leave this as is then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL