Error importing PyQt5
#1
Hi everyone,

I am looking into building GUIs with Python on postmarketOS.  I am (currently) using plasma-mobile so I figured it would make sense to use PyQt5, maybe with Kirigami.  So I installed py3-qt5 (version 5.13.1-r1) from the community repository using APK.  However, when I go to import QtGui from PyQt5 in python3 I get the following error:


Code:
Python 3.8.1 (default, Jan 19 2020, 11:48:03)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtGui
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
ImportError: Error relocating /usr/lib/python3.8/site-packages/PyQt5/QtGui.so: _ZNK17QOpenGLTimerQuery16waitForTimestampEv: symbol not found

Trying to import QtWidgets gives the same error.

As well as the required dependencies for py3-qt5, I also installed py3-opengl to see if it would solve the problem (given the content of the error message) but it didn't help.  I also installed qutebrowser and its dependencies and, although I can't see the full error message it returns, it appears to have the exact same problem.  The full list of packages I have installed can be found at https://pastebin.com/HmgzaNPm.

Can anyone shed any light of what is wrong here?  Googling around doesn't really yield any relevant results.  I am reasonably familiar with Python but less so with Qt or C++.  So I'm not sure if I am missing something here.

Thanks!
#2
Seems like PyQt5 needs a rebuild. However, I just tried the same on my Alpine laptop (running the latest edge) and it works fine, so I guess it has been rebuild already.

Please update your system, `apk update && apk upgrade -a`, and try again
#3
Hi there, thanks for your advice. I ran update and upgrade -a and the issue remains. For the record, py3-qt5 was not upgraded (nor were any qt-related packages).

Interesting that you do not have the same issue on your laptop. Is anyone able to replicate this on a pinephone?
#4
Although "upgrade -a" should've already installed the latest version available, could you verify that you have py3-qt5 version 5.13.1-r1 installed? "apk list -I | grep py3-qt5"
#5
Confirmed:


Code:
py3-qt5-5.13.1-r1 aarch64 {py3-qt5} (GPL-2.0-or-later) [installed]
#6
Well I guess the only thing you can do then is rebuild the package yourself.
#7
I had the same bug. I reported it to alpine linux's aports here: https://gitlab.alpinelinux.org/alpine/ap...sues/11244

trying to build py3-qt5 with the supplied APKBUILD results in:

Code:
>>> py3-qt5: Analyzing dependencies...
  mesa-git-gbm-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-gbm=19.3.4-r1]
    satisfies: mesa-git-dri-gallium-0_git20200202-r2[mesa-git-gbm]
               xorg-server-1.20.7-r0[so:libgbm.so.1]
               kwin-5.18.1-r1[so:libgbm.so.1]
               qt5-qtbase-x11-9999-r17[so:libgbm.so.1]
               xdg-desktop-portal-kde-5.18.1-r1[so:libgbm.so.1]
               mesa-git-egl-0_git20200202-r2[so:libgbm.so.1]
               xorg-server-xwayland-1.20.7-r0[so:libgbm.so.1]
  mesa-git-glapi-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-glapi=19.3.4-r1]
    satisfies: mesa-git-dri-gallium-0_git20200202-r2[mesa-git-glapi]
               mesa-git-dri-gallium-0_git20200202-r2[so:libglapi.so.0]
               mesa-git-gl-0_git20200202-r2[so:libglapi.so.0]
               mesa-git-gles-0_git20200202-r2[so:libglapi.so.0]
               mesa-git-egl-0_git20200202-r2[so:libglapi.so.0]
               mesa-git-osmesa-0_git20200202-r2[so:libglapi.so.0]
  mesa-git-egl-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-egl=19.3.4-r1]
    satisfies: mesa-git-dri-gallium-0_git20200202-r2[mesa-git-egl]
               gst-plugins-base-1.16.2-r2[so:libEGL.so.1]
               qt5-qtwayland-5.12.5-r3[so:libEGL.so.1]
               qt5-qtbase-x11-9999-r17[so:libEGL.so.1]
               plasma-framework-5.67.0-r1[so:libEGL.so.1]
               kwayland-5.67.0-r1[so:libEGL.so.1]
  mesa-git-gl-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-gl=19.3.4-r1]
    satisfies: mesa-git-dri-gallium-0_git20200202-r2[mesa-git-gl]
               charging-sdl-0.1-r1[mesa-gl]
               osk-sdl-0.54-r0[mesa-gl]
               gst-plugins-base-1.16.2-r2[so:libGL.so.1]
               v4l-utils-1.18.0-r0[so:libGL.so.1]
               xorg-server-1.20.7-r0[so:libGL.so.1]
               qt5-qtwayland-5.12.5-r3[so:libGL.so.1]
               qt5-qtmultimedia-5.12.5-r2[so:libGL.so.1]
               qt5-qtwebkit-5.9.1-r9[so:libGL.so.1]
               plasma-framework-5.67.0-r1[so:libGL.so.1]
               xorg-server-xwayland-1.20.7-r0[so:libGL.so.1]
  mesa-git-gles-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-gles=19.3.4-r1]
    satisfies: mesa-git-dri-gallium-0_git20200202-r2[mesa-git-gles]
               qt5-qtbase-x11-9999-r17[so:libGLESv2.so.2]
  mesa-git-osmesa-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-osmesa=19.3.4-r1]
  mesa-git-xatracker-0_git20200202-r2:
    breaks: mesa-dev-19.3.4-r1[mesa-xatracker=19.3.4-r1]

As per the alpinelinux dev's request. I have reported the issue on pmos issue tracker: https://gitlab.com/postmarketOS/pmaports/issues/454
#8
Ah yeah the mesa-git mess is a pmOS specific bug, py3-qt5 not working in the first place is an Alpine Linux one.
#9
Thanks both! It's good to know that at least it's reproducible, and thanks anjanmomi for filing the issue.
#10
Btw the original issue of this thread is now resolved. Just upgrade your system!

Code:
apk update
apk upgrade --available

(note the "--available" switch)


Possibly Related Threads…
Thread Author Replies Views Last Post
  constant apk error message iwm 2 3,099 11-15-2021, 07:25 PM
Last Post: iwm
  Error when updating syrinx 1 2,655 03-06-2021, 01:32 AM
Last Post: hiimtye
  pmbootstrap error lat 2 4,068 12-22-2020, 06:32 PM
Last Post: lat
  chroot can't execute passwd exec format error dimm82 5 6,748 09-18-2020, 07:53 AM
Last Post: krsmith28p
Sad ERROR: Could not find dependency 'firmware-rtl8723bt' Engineer 4 6,886 06-16-2020, 12:29 PM
Last Post: Engineer

Forum Jump:


Users browsing this thread: 1 Guest(s)