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

PyQt5 pyplot error #6858

Closed
plooney opened this issue Jul 29, 2016 · 7 comments
Closed

PyQt5 pyplot error #6858

plooney opened this issue Jul 29, 2016 · 7 comments

Comments

@plooney
Copy link

plooney commented Jul 29, 2016

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

@Kojoley
Copy link
Member

Kojoley commented Jul 29, 2016

Duplicate #6853

@tacaswell
Copy link
Member

Closed by #6854

@QuLogic QuLogic added this to the 2.0 (style change major release) milestone Aug 1, 2016
@mogrodnik
Copy link

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.

@QuLogic
Copy link
Member

QuLogic commented Mar 20, 2017

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

@fstefanoni
Copy link

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

@jenshnielsen
Copy link
Member

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

@fstefanoni
Copy link

@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
Projects
None yet
Development

No branches or pull requests

7 participants