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

How to prevent matplotlib from importing qt4 libraries when only #7021

Closed
dickreuter opened this issue Sep 4, 2016 · 4 comments
Closed

How to prevent matplotlib from importing qt4 libraries when only #7021

dickreuter opened this issue Sep 4, 2016 · 4 comments

Comments

@dickreuter
Copy link

I'm currently having problems compiling a solution that contains pyqt5 and matplotlib with pyinstaller. An error is caused by the fact that matplotlib seems to import qt4 libraries even though they are not used (in my case I specify matplotlib.use('Qt5Agg')).

As a result the compiled solution throws an error saying RuntimeError: the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class.

This is currently discussed on the pyinstaller issues log as well but we have come to the conclusion that this should probably be solved in matplotlib: pyinstaller/pyinstaller#2174 (comment)

Any suggestions how to prevent matplotlib from importing qt4 are appreciated.

@jenshnielsen
Copy link
Member

Using the QT5 backend should most certainly not import any QT4 modules.

Can you please provide a minimum example of what you are trying to do that produces this issue along with the information that we asked for in the issue template (Matplotlib version, operating system, python version and so on)

@tacaswell
Copy link
Member

As I commented on the pyinstaller issue, this is something that needs to be fixed on their side. It sounds like pyinstaller is just searching the code for imports and can not cope with conditional conflicting imports.

@dickreuter
Copy link
Author

thanks, makes sense

On 4 September 2016 at 17:36, Thomas A Caswell notifications@github.com
wrote:

As I commented on the pyinstaller issue, this is something that needs to
be fixed on their side. It sounds like pyinstaller is just searching the
code for imports and can not cope with conditional conflicting imports.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#7021 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABMrfm24-OC92Wfs5QDSP67llNqjOsVcks5qmvOngaJpZM4J0kAt
.

@tacaswell
Copy link
Member

Closing as a pyinstaller bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants