Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect default backend set for matplotlib after installing pyside #4883

Closed
skirpichev opened this issue Aug 7, 2015 · 9 comments
Closed
Labels
Milestone

Comments

@skirpichev
Copy link
Contributor

After installation, matplotlibrc has backend : pyside line, and when I try to import one from the IPython's qtconsole it emits a warning:

/home/sk/.virtualenvs/ipy/local/lib/python2.7/site-packages/matplotlib/__init__.py:1039: UserWarning: Bad val "pyside" on line #38
    "backend      : pyside
"
    in file "/home/sk/.virtualenvs/ipy/local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc"
    Key backend: Unrecognized backend string "pyside": valid strings are [u'pgf', u'cairo', u'MacOSX', u'CocoaAgg', u'gdk', u'ps', u'GTKAgg', u'nbAgg', u'GTK', u'Qt5Agg', u'template', u'emf', u'GTK3Cairo', u'GTK3Agg', u'WX', u'Qt4Agg', u'TkAgg', u'agg', u'svg', u'GTKCairo', u'WXAgg', u'WebAgg', u'pdf']
  (val, error_details, msg))

Perhaps, something was left after #3387.

See also this thread on SO.

@WeatherGod
Copy link
Member

Hmm, unlikely. I suspect that an older version of matplotlib is getting
picked up. What does "matplotlib.version" say?

On Fri, Aug 7, 2015 at 12:30 PM, Sergey B Kirpichev <
notifications@github.com> wrote:

After installation, matplotlibrc has backend : pyside line, and when I
try to import one from the IPython's qtconsole it emits a warning:

/home/sk/.virtualenvs/ipy/local/lib/python2.7/site-packages/matplotlib/init.py:1039: UserWarning: Bad val "pyside" on line #38
"backend : pyside
"
in file "/home/sk/.virtualenvs/ipy/local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc"
Key backend: Unrecognized backend string "pyside": valid strings are [u'pgf', u'cairo', u'MacOSX', u'CocoaAgg', u'gdk', u'ps', u'GTKAgg', u'nbAgg', u'GTK', u'Qt5Agg', u'template', u'emf', u'GTK3Cairo', u'GTK3Agg', u'WX', u'Qt4Agg', u'TkAgg', u'agg', u'svg', u'GTKCairo', u'WXAgg', u'WebAgg', u'pdf'](val, error_details, msg))

Perhaps, something was left after #3387
#3387.

See also this thread
http://stackoverflow.com/questions/28168542/incorrect-default-backend-set-for-matplotlib-after-installing-pyside
on SO.


Reply to this email directly or view it on GitHub
#4883.

@skirpichev
Copy link
Contributor Author

On Fri, Aug 07, 2015 at 10:06:41AM -0700, Benjamin Root wrote:

Hmm, unlikely. I suspect that an older version of matplotlib is getting
picked up. What does "matplotlib.version" say?

The latest release:
~ $ workon ipy
(ipy):~ $ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib; matplotlib.version
'1.4.3'
^D
(ipy):~ $

@tacaswell
Copy link
Member

Can you paste in the header of the build output? I am interested in exactly which existing modules mpl found and how you set up your venv.

@skirpichev
Copy link
Contributor Author

On Fri, Aug 07, 2015 at 01:43:02PM -0700, Thomas A Caswell wrote:

Can you paste in the header of the build output? I am interested in
exactly which existing modules mpl found

egg_info? Attached at the end.

and how you set up your venv.

Minimal reproducible example on the Debian Wheezy:
$ mkvirtualenv test
$ pip install pyside
$ pip install matplotlib
$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import matplotlib
/home/sk/.virtualenvs/test/local/lib/python2.7/site-packages/matplotlib/init.py:1039: UserWarning: Bad val "pyside" on line #38
"backend : pyside
"
in file "/home/sk/.virtualenvs/test/local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc"
Key backend: Unrecognized backend string "pyside": valid strings are [u'pgf', u'cairo', u'MacOSX', u'CocoaAgg', u'gdk', u'ps', u'GTKAgg', u'nbAgg', u'GTK', u'Qt5Agg', u'template', u'emf', u'GTK3Cairo', u'GTK3Agg', u'WX', u'Qt4Agg', u'TkAgg', u'agg', u'svg', u'GTKCairo', u'WXAgg', u'WebAgg', u'pdf'](val, error_details, msg))

Running setup.py egg_info for package matplotlib
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [1.4.3]
                python: yes [2.7.3 (default, Mar 13 2014, 11:03:55)  [GCC
                        4.7.2]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
                   six: yes [six was not found.pip will attempt to install
                        it after matplotlib.]
              dateutil: yes [dateutil was not found. It is required for date
                        axis support. pip/easy_install may attempt to
                        install it after matplotlib.]
                  pytz: yes [pytz was not found. pip will attempt to install
                        it after matplotlib.]
               tornado: yes [tornado was not found. It is required for the
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [pyparsing was not found. It is required for
                        mathtext support. pip/easy_install may attempt to
                        install it after matplotlib.]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: yes [version 2.4.9]
                   png: yes [version 1.2.49]
                 qhull: yes [pkg-config information for 'qhull' could not be
                        found. Using local copy.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: yes [nose 0.11.1 or later is required to run the
                        matplotlib test suite.  pip/easy_install may attempt
                        to install it after matplotlib. / mock is required
                        to run the matplotlib test suite.  pip/easy_install
                        may attempt to install it after matplotlib.]
        toolkits_tests: yes [nose 0.11.1 or later is required to run the
                        matplotlib test suite.  pip/easy_install may attempt
                        to install it after matplotlib. / mock is required
                        to run the matplotlib test suite.  pip/easy_install
                        may attempt to install it after matplotlib.]

OPTIONAL BACKEND EXTENSIONS
                macosx: no  [Mac OS-X only]
                qt5agg: no  [PyQt5 not found]
                qt4agg: no  [PyQt4 not found]
                pyside: yes [installing, Qt: 4.8.6, PySide: 1.2.2]
               gtk3agg: no  [Requires pygobject to be installed.]
Running from numpy source directory.

@tacaswell
Copy link
Member

Thanks! That information is perfect.

@tacaswell tacaswell added this to the Color overhaul milestone Aug 8, 2015
@tacaswell tacaswell added the Build label Aug 8, 2015
@tacaswell
Copy link
Member

What is behind mkvirtualenv test? I went with pyvenv create test; source test/bin/activate

@skirpichev
Copy link
Contributor Author

On Sun, Aug 09, 2015 at 09:48:26PM -0700, Thomas A Caswell wrote:

What is behind mkvirtualenv test?

https://virtualenvwrapper.readthedocs.org/

I went with pyvenv create test; source
test/bin/activate

virtualenvwrapper uses virtualenv, but I don't think that matter.

@tacaswell
Copy link
Member

I can confirm this happens, no idea why.

@tacaswell
Copy link
Member

Closing as this is fixed on master and will be fixed for 1.5 #3387 actually fixed this problem with https://github.com/matplotlib/matplotlib/pull/3387/files#diff-c28358ce9623af21f7b6e068f69085b7L2022 which removes the name 'pyside' which is used here: https://github.com/matplotlib/matplotlib/blob/master/setup.py#L280 to set the value of the default backend which is written out into the base rc file here: https://github.com/matplotlib/matplotlib/blob/master/setup.py#L319

@tacaswell tacaswell modified the milestones: Color overhaul, next major release (2.0) Oct 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants