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

import qtpy raise except when only have PyQt4 #280

Closed
DengZuoheng opened this issue Nov 17, 2021 · 6 comments · Fixed by #281
Closed

import qtpy raise except when only have PyQt4 #280

DengZuoheng opened this issue Nov 17, 2021 · 6 comments · Fixed by #281
Assignees
Labels
Milestone

Comments

@DengZuoheng
Copy link

DengZuoheng commented Nov 17, 2021

from . import QtDataVisualization as QtDatavisualization

>>> import qtpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/python3.8/site-packages/qtpy/__init__.py", line 237, in <module>
    from . import QtDataVisualization as QtDatavisualization
  File "/python3.8/site-packages/qtpy/QtDataVisualization.py", line 22, in <module>
    raise PythonQtError('No Qt bindings could be found')

Why you remove the QT_API check before import QtDataVisualization since 1.11.2?

@dalthviz dalthviz added this to the v1.11.3 milestone Nov 17, 2021
@dalthviz dalthviz self-assigned this Nov 17, 2021
@dalthviz
Copy link
Member

Hi @DengZuoheng thank you for the feedback! Regarding this issue, we added the lines causing it in order to keep compatibility since previously to import QtDataVisualization we were using QtDatavisualization instead of QtDataVisualization (note the lower case v). Before this aliasing was done I suspect this error could happen only if you directly runned something like from qtpy import QtDatavisualization while using Qt4 (either PySide or PyQt4).

Anyhow, hope the info above clarifies a little bit the situation :)

@dalthviz
Copy link
Member

Also @DengZuoheng , just out of curiosity, you keep using Qt4 in your current projects?

@DengZuoheng
Copy link
Author

@dalthviz thanks for your prompt reply. And yes, we still using Qt4 now, and we going to upgrade to Qt5 next year. Before that we trying to upgrade qtconsole, and meet this issue.

@CAM-Gerlach
Copy link
Member

@dalthviz I assume we'll drop support in QtConsole at some point soon, if we haven't already done so?

Also, just FYI @DengZuoheng , QtPy 1.12 (presumably the last minor release of the 1.x series) will formally deprecate the Qt4 bindings (which have been mostly untested since QtPy 1.9.x) and QtPy 2.0 will no longer support Qt <5.6 for sure, maybe Qt <5.9 (since we can't easily test on versions lower than that and they are long-EoL upstream) and possibly even Qt <5.12, to allow for new functionality, cleaner code and higher performance with less maintenance overhead.

@dalthviz
Copy link
Member

@dalthviz thanks for your prompt reply. And yes, we still using Qt4 now, and we going to upgrade to Qt5 next year. Before that we trying to upgrade qtconsole, and meet this issue.

Thanks @DengZuoheng for the answer, glad to know that you are already checking a migration plan 👍

@dalthviz I assume we'll drop support in QtConsole at some point soon, if we haven't already done so?

I think that depends on QtConsole adding a constrain in QtPy but maybe @ccordoba12 knows better

@ccordoba12
Copy link
Member

we'll drop support in QtConsole at some point soon, if we haven't already done so?

I doubt Qtconsole can still work with PyQt4 because it only supports Python 3.6+ (and I think there are no PyQt4 packages for that version).

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