Visitar URL original
PyQt5 pyplot error · Issue #6858 · matplotlib/matplotlib · GitHub
Skip to content

PyQt5 pyplot error #6858

Description

@plooney

Ubuntu 16.04
Python 3.5.2
matplotlib 1.5.1
PyQt5 5.7

Installed using pip in anaconda

QObject::connect: Cannot connect NavigationToolbar2QT::message(QString) to (null)::_show_message()
Traceback (most recent call last):
File "test_conv.py", line 14, in
plt.plot(xvals)
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 3147, in plot
ax = gca()
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 928, in gca
return gcf().gca(*_kwargs)
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 578, in gcf
return figure()
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 527, in figure
*_kwargs)
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 43, in new_figure_manager
return new_figure_manager_given_figure(num, thisFig)
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 51, in new_figure_manager_given_figure
return FigureManagerQT(canvas, num)
File "/home/padraig/.local/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 465, in init
self.toolbar.message.connect(self._show_message)
TypeError: connect() failed between NavigationToolbar2QT.message[str] and _show_message()

Activity

  1. Kojoley commented on Jul 29, 2016

    @Kojoley
    Member

    Duplicate #6853

  2. tacaswell commented on Jul 31, 2016

    @tacaswell
    Member

    Closed by #6854

  3. added this to the milestone on Aug 1, 2016
  4. mogrodnik commented on Mar 20, 2017

    @mogrodnik

    I am having similar output after updating (with portage):
    sip-4.19.1 [from 4.18]
    PyQt5-5.7.1 [from 5.5.1]
    PyQt4-4.12 [from 4.11.4-r1]
    and trying to run any plotting script.

    Error message is:
    QObject::connect: Cannot connect NavigationToolbar2QT::message(QString) to (null)::_show_message()
    Traceback (most recent call last):
    File "2.py", line 5, in
    plt.xlim (0.1 , 5.0 )
    File "/usr/lib64/python3.4/site-packages/matplotlib/pyplot.py", line 1488, in xlim
    ax = gca()
    File "/usr/lib64/python3.4/site-packages/matplotlib/pyplot.py", line 828, in gca
    ax = gcf().gca(**kwargs)
    File "/usr/lib64/python3.4/site-packages/matplotlib/pyplot.py", line 462, in gcf
    return figure()
    File "/usr/lib64/python3.4/site-packages/matplotlib/pyplot.py", line 435, in figure
    **kwargs)
    File "/usr/lib64/python3.4/site-packages/matplotlib/backends/backend_qt5agg.py", line 48, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
    File "/usr/lib64/python3.4/site-packages/matplotlib/backends/backend_qt5agg.py", line 56, in new_figure_manager_given_figure
    return FigureManagerQT(canvas, num)
    File "/usr/lib64/python3.4/site-packages/matplotlib/backends/backend_qt5.py", line 481, in init
    self.toolbar.message.connect(self._show_message)
    TypeError: connect() failed between NavigationToolbar2QT.message[str] and _show_message()

    With my current configuration this can be reproduced with plotting script using matplotlib, enough should be just:
    from pylab import *
    import matplotlib.pyplot as plt
    plt.xlim (0.1 , 5.0 )

    I use matplotlib 1.4.3
    python version 2.7.12 (result is the same for python 3.4.5)
    platform version 1.0.7
    on gentoo (version 4.4.39-gentoo (root@migi) (gcc version 4.9.4 (Gentoo 4.9.4 p1.0, pie-0.6.4) ) #1 SMP Mon Feb 20 15:16:15 CET 2017)

    If sip, PyQt4 and PyQt5 are downgraded to previously used versions, everything runs smoothly.

  5. QuLogic commented on Mar 20, 2017

    @QuLogic
    Member

    As you can see from the milestone, this bug was fixed in 2.0.0; 1.4.3 is very old now.

  6. fstefanoni commented on Jun 8, 2017

    @fstefanoni

    Hi!
    I use matplotlib 1.5.1, Python 3.5.2 and Anaconda 4.1.1.
    I get the same error message:

    QObject::connect: Cannot connect NavigationToolbar2QT::message(QString) to (null)::_show_message()
    Traceback (most recent call last):
    File "/Users/francescastefanoni/Desktop/read.py", line 27, in
    plt.plot(t,IOP)
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/pyplot.py", line 3147, in plot
    ax = gca()
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/pyplot.py", line 928, in gca
    return gcf().gca(**kwargs)
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/pyplot.py", line 578, in gcf
    return figure()
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/pyplot.py", line 527, in figure
    **kwargs)
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 43, in new_figure_manager
    return new_figure_manager_given_figure(num, thisFig)
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 51, in new_figure_manager_given_figure
    return FigureManagerQT(canvas, num)
    File "/Users/francescastefanoni/anaconda/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 465, in init
    self.toolbar.message.connect(self._show_message)
    TypeError: connect() failed between NavigationToolbar2QT.message[str] and _show_message()

    Does anybody know which is the problem and how to solve it?? Thank you

  7. jenshnielsen commented on Jun 8, 2017

    @jenshnielsen
    Member

    @fstefanoni this was fixed in matplotlib 1.5.3 you will have to upgrade to at least that version to get the fix

  8. fstefanoni commented on Jun 8, 2017

    @fstefanoni

    @jenshnielsen thank you very much!! Now it works:)

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions