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

pyside2 as qt5 backend · Issue #8618 · matplotlib/matplotlib · GitHub

Repository navigation

pyside2 as qt5 backend #8618

Closed
Closed

Description

Bug report

Bug summary
using Pyside2 as a qt5 backend is failing

Code for reproduction

import matplotlib; matplotlib.use('Qt5Agg'); matplotlib.rcParams['backend.qt5']='PySide2'
import matplotlib.pyplot as plt
fig, ax = plt.subplots()

Actual outcome

    fig, ax = plt.subplots()
  File "<...>/lib/python3.6/site-packages/matplotlib/pyplot.py", line 1189, in subplots
    fig = figure(**fig_kw)
  File "<...>/lib/python3.6/site-packages/matplotlib/pyplot.py", line 544, in figure
    **kwargs)
  File "<...>/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 44, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
  File "<...>/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 51, in new_figure_manager_given_figure
    canvas = FigureCanvasQTAgg(figure)
  File "<...>/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 246, in __init__
    super(FigureCanvasQTAgg, self).__init__(figure=figure)
  File "<...>/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py", line 68, in __init__
    super(FigureCanvasQTAggBase, self).__init__(figure=figure)
  File "<...>/lib/python3.6/site-packages/matplotlib/backends/backend_qt5.py", line 246, in __init__
    super(FigureCanvasQT, self).__init__(figure=figure)
AttributeError: 'figure()' is not a Qt property or a signal

Matplotlib version

  • Operating System: Ubuntu 17.04
  • Matplotlib Version: f107207 (latest commit on master)
  • Python Version: 3.6.1
  • Other Libraries: Qt 5.8.0 + Pyside2

what can I do ?

Activity

  1. tacaswell commented on May 15, 2017

    Member

    Is pyside2 not cooperative? If not we need to run the it through the qt4Agg code path instead of directly through the qt5 code path.

  2. added this to the milestone on May 15, 2017
  3. t-bltg commented on May 20, 2017

    Author

    I have made progress and was able to build matplotlib with qt4/pyside and qt5/pyside2

    Here is the patch: t-bltg@13a5d5b

    I used qtpy from spyder as proposed in #6118

    I ran the test suite python -c 'import matplotlib; matplotlib.test()', and it passed without issues on this part.

    Should I make a pull request ?

  4. tacaswell commented on May 22, 2017

    Member

    Yes please, but it will need a few more modifications.

    • if we are going to us qtpy then we should delete our entire compatibility shim and add it as a hard dependency
    • I am not a fan of the if statement in the init, either we should fully merge the qt4/qt5 code bases or run the qt5 + pyside2 through the qt4 code paths (which already account for the non-cooperative super classes

    This probably crosses paths with #8613

    Is there a reasonable path where we have a shim backend called 'qtagg' which imports from qt_compat and then decides if it needs to use the cooperative or non-cooperative versions of the classes?

    It is really disappointing that pyside2 is not cooperative 😞 .

  5. modified the milestones: , on Aug 14, 2017
  6. anntzer commented on Aug 26, 2017

    Contributor

    Closed by #9052.

  7. modified the milestones: , on Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL