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

PyQt version import error prevents application from launching #1324

Closed
marek-lach opened this issue Jan 29, 2023 · 6 comments · Fixed by #1325
Closed

PyQt version import error prevents application from launching #1324

marek-lach opened this issue Jan 29, 2023 · 6 comments · Fixed by #1325
Assignees
Labels
bug Issue: Something isn't working
Milestone

Comments

@marek-lach
Copy link

Sorry for the inconvenience, but is there any idea what this output could possibly mean?

https://pastebin.com/H8nXudaX

Thanks for looking into it.

@marek-lach marek-lach added the bug Issue: Something isn't working label Jan 29, 2023
@marek-lach marek-lach changed the title PyQt import error prevents application from launching PyQt version import error prevents application from launching Jan 29, 2023
@vkbo
Copy link
Owner

vkbo commented Jan 29, 2023

Pasting the backtrace here so I don't have to go to a third party service:

Traceback (most recent call last):
  File "/usr/bin/novelwriter", line 33, in <module>
    sys.exit(load_entry_point('novelWriter==2.0.3', 'gui_scripts', 'novelwriter')())
  File "/usr/bin/novelwriter", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/novelwriter/__init__.py", line 33, in <module>
    from novelwriter.config import Config
  File "/usr/lib/python3.10/site-packages/novelwriter/config.py", line 33, in <module>
    from PyQt5.Qt import PYQT_VERSION_STR
ImportError: cannot import name 'PYQT_VERSION_STR' from 'PyQt5.Qt' (/usr/lib/python3.10/site-packages/PyQt5/Qt.abi3.so)

@vkbo
Copy link
Owner

vkbo commented Jan 29, 2023

The PYQT_VERSION_STR is something PyQt5 adds. Maybe they've made a change?

What PyQt5 version is actually installed, and from what source?

@vkbo
Copy link
Owner

vkbo commented Jan 29, 2023

It is still in their docs, but importable from QtCore: https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtcore/qtcore-module.html?highlight=pyqt_version_str##PYQT_VERSION_STR

I see that novelWriter imports it from Qt directly, so perhaps that was just an import bleed through that has been changed. If so, this is a bug in novelWriter and needs to be fixed.

@vkbo vkbo self-assigned this Jan 29, 2023
@vkbo vkbo added this to the Release 2.0.4 milestone Jan 29, 2023
@vkbo vkbo mentioned this issue Jan 29, 2023
6 tasks
@vkbo vkbo linked a pull request Jan 29, 2023 that will close this issue
6 tasks
@vkbo
Copy link
Owner

vkbo commented Jan 29, 2023

I've made a fix, and I'll see if I can complete some other fixes tomorrow and do a 2.0.4 release.

@vkbo
Copy link
Owner

vkbo commented Jan 29, 2023

Aha! Mystery solved. This is a change in PyQt5 version 5.15.8 which was released a few hours ago.
https://www.riverbankcomputing.com/news/PyQt_v5.15.8_Released

All my CI jobs on GitHub started to fail now as they pull in the latest version. I have 5.15.2 on my system.

@vkbo
Copy link
Owner

vkbo commented Jan 29, 2023

Fixed and released 2.0.4.

@vkbo vkbo closed this as completed Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue: Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants