Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Try importing PySide, if we can't find sip. #2142

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

Merged
merged 2 commits into from
Jul 6, 2013
Merged

Try importing PySide, if we can't find sip. #2142

merged 2 commits into from
Jul 6, 2013

Conversation

punchagan
Copy link
Contributor

If no QT_API is specified, we use the value in rcParams and the
default value for this is PyQt. If a user has PySide installed,
trying to use the qt backend fails, unless QT_API is specified or the
config file is modified. This commit, adds code to try and import
PySide, if an import of PyQt fails.

@bmu
Copy link

bmu commented Jun 27, 2013

+1 for this.

as an example anaconda doesn't install pyqt, but pyside and you will get an import error for sip (see the mailing list).

As a workaround I set the QT_API now, which works but is not very convenient and difficult to do for an inexperienced user.

@punchagan
Copy link
Contributor Author

Does anybody have any comments on this patch? Objections or suggestions for improvement?

@efiring
Copy link
Member

efiring commented Jul 2, 2013

Looks reasonable to me.

@mdboom
Copy link
Member

mdboom commented Jul 2, 2013

I just noticed that QT_API isn't documented anywhere. It's hard to know where that should go, but maybe in the usage Faq as another question after "what is a backend?", we could add "How do I select PyQt4 or PySide?", and it could describe QT_API and this implicit behavior here.

@punchagan
Copy link
Contributor Author

I added some documentation to this effect. Feel free to suggest changes, or modify as required.

@dmcdougall
Copy link
Member

@punchagan This needs a rebase, but other than that I think this can be merged. Thanks for the patch.

@punchagan
Copy link
Contributor Author

@dmcdougall Done. Thanks!

punchagan added 2 commits July 6, 2013 12:25
If no QT_API is specified, we use the value in rcParams and the
default value for this is PyQt.  If a user has PySide installed,
trying to use the qt backend fails, unless QT_API is specified or the
config file is modified.  This commit, adds code to try and import
PySide, if an import of PyQt fails.
dmcdougall added a commit that referenced this pull request Jul 6, 2013
Try importing PySide, if we can't find sip.
@dmcdougall dmcdougall merged commit 3597917 into matplotlib:master Jul 6, 2013
@punchagan punchagan deleted the fix-qt-import branch July 7, 2013 07:45
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

Successfully merging this pull request may close these issues.

5 participants