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
Unable to use PySide with gui=qt #6164
Comments
I have also reproduced this issue in anaconda with python 2.7.11 and ipython 4.0.1. |
What does from PySide import QtCore, QtGui, __version__, __version_info_ do? |
I can not reproduce this on 2.7 or 3.5 with pyside installed from Arch system packages in a venv + pip installed mpl 1.5.1. |
@tacaswell Thank you for the pointer. I think I have the issue narrowed down. If I have both PyQt4 and PySide installed and do not have
Is it possible for matplotlib to check and see if an existing qt binding is already imported and use that instead of backend.qt4? Our basic use-case is that we want users to run a file that creates a matplotlib animation and specify qt as the backend. |
All of that logic lives in Before doing any rcparams look up we could check what is already in IPython has their own qt shim layer which might be part of what is causing the mis-match. |
That sounds like a good solution to me. |
Can you check if #6174 work for you? |
Sure does @tacaswell. Just tested it out and works great. Thanks for the fix. |
If PySide, PyQt4, or PyQt5 are imported do not consult rcparams or ENV variable to decide which backend to use. This is a case where ignoring user input is sensible because the Qt bindings are mutually exclusive and attempting to import a second binding will fail. This can result in stand-alone scripts / mpl embeddings which are dependent on the rcparams to function correctly. Importing a specific Qt binding is stronger signal of user intent that either of the other two configuration options and should take precedence. closes matplotlib#6164
I think this issue has to be fixed in matplotlib. I got he same error, but strangely enough it shows only when in debug mode (using pycharm). I got it "fixed" by uninstalling all the pyside packages. from PySide import QtCore, QtGui, version, version_info has never worked for me. I always get an error ImportError: cannot import name 'version' whether I have PySide installed or not. Uninstalling PySide solved the problem for me, but the handing of the problem is not properly done and its message is misleading. The checks should say something about the incompatibility between the PyQt and PySide. Why is this showing only in debug mode? Is there anything configured wrong on my system? |
@bhlevca What version of mpl are you using? This fix should be in 1.5.3 and the 2.0.0 betas. |
I have 1.5.3 for python 3 and 1.5.1 for python 2, but I use only python 3 and the error I reported was in an python 3 environment. Do you want me do do any tests to get to the problem quickly? |
@bhlevca Please open a new issue with exactly what you are doing. |
I am debugging something at the moment and in order to reproduce the issue I will have the reinstall PySide. If I have time tonight I will try to reinstall PySide and reproduce the issue again or I can jsut copy my initial report and open the issue with that. Basically when in debugging mode with pyside installed the debugging session is immediately stopped in qt_compat.py at this line where it rises an exception:
|
What version of pyside do you have installed? 14:54 $ python
Python 3.5.2 (default, Jun 28 2016, 08:46:01)
[GCC 6.1.1 20160602] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide import QtCore, QtGui, __version__, __version_info__
>>> __version__
'1.2.4'
>>> __version_info__
(1, 2, 4, 'final', 0)
>>> |
https://srinikom.github.io/pyside-docs/pysideversion.html As of 1.0.2 this is the documented way to get the version of pyside. |
I don't have PySide anymore as it did not work for me with it installed as I explained above. As for Python version I have 3.4.5
|
That trace back makes me think you do not have pyside installed properly. |
As I said I removed it because it was causing problems. Therefore, I don't have pyside installed at all on my system. NO PySide. so the trace is normal. I will install it back what and if I get some free time to play with it. |
Using matplotlib 1.5.1 with Enthought Canopy (python 2.7.10 and ipython 4.1.2), if I run
ipython --gui=qt
and thenimport matplotlib.pyplot as plt
the following exception is raised despite both PySide and PyQt4 being installed.This happens with matplotlibrc
backend.qt4 : PySide
but notbackend.qt4 : PyQt4
.The text was updated successfully, but these errors were encountered: