bland-father-19717
05/11/2022, 9:43 AMfrom PyQt5.QtWidgets import QApplication
ImportError: dlopen(/Users/xxx/.cache/pants/named_caches/pex_root/installed_wheels/33ced1c876f6a26e7899615a5a4efef2167c263488837c7beed023a64cebd051/PyQt5-5.15.6-cp36-abi3-macosx_10_13_x86_64.whl/PyQt5/QtWidgets.abi3.so, 2): Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
Referenced from: /Users/xxx/.cache/pants/named_caches/pex_root/installed_wheels/33ced1c876f6a26e7899615a5a4efef2167c263488837c7beed023a64cebd051/PyQt5-5.15.6-cp36-abi3-macosx_10_13_x86_64.whl/PyQt5/QtWidgets.abi3.so
Reason: image not found
enough-analyst-54434
05/11/2022, 2:39 PMPyQt5-5.15.6
wheel is not self contained with a fully static Qt. It relies on Qt being installed on the local machine. So you'll need to install Qt on any machine that wants to run a PEX with that PyQt5-5.15.6
wheel as a dependency.
To be clear, this is not a PEX specific problem. Just examining the wheel contents directly can let you know if the wheel will work on your machine. For example, on my machine it will not:
$ curl -sSL <https://files.pythonhosted.org/packages/36/66/19983d471c702e551a19a7225a92a7c1efadd961f6c650110ed906dd0ed7/PyQt5-5.15.6-cp36-abi3-manylinux1_x86_64.whl> -O
$ mkdir PyQt5-5.15.6
$ unzip -d PyQt5-5.15.6 PyQt5-5.15.6-cp36-abi3-manylinux1_x86_64.whl
$ ldd PyQt5-5.15.6/PyQt5/QtWidgets.abi3.so
ldd: warning: you do not have execution permission for `PyQt5-5.15.6/PyQt5/QtWidgets.abi3.so'
linux-vdso.so.1 (0x00007fff1a0ba000)
libQt5Widgets.so.5 => not found
libQt5Gui.so.5 => not found
libQt5Core.so.5 => not found
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f8d67bb1000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f8d679a7000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f8d678bd000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f8d68379000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f8d678a2000)
Note there are three expected shared libraries that do not link on my machine since I don't have Qt installed at all (I run Gnome, not KDE).bland-father-19717
05/12/2022, 5:47 AMpoetry run python main.py
?
pyproject.toml
[tool.poetry.dependencies]
python = "^3.8"
PyQt5 = "^5.15.6"
main.py
from PyQt5.QtWidgets import QApplication
enough-analyst-54434
05/13/2022, 2:01 PMdlopen(/Users/xxx/.cache/pants/named_caches/pex_root/installed_wheels/33ced1c876f6a26e7899615a5a4efef2167c263488837c7beed023a64cebd051/PyQt5-5.15.6-cp36-abi3-macosx_10_13_x86_64.whl/PyQt5/QtWidgets.abi3.so, 2): Library not loaded: @rpath/QtWidgets.framework/Versions/5/QtWidgets
Referenced from: /Users/xxx/.cache/pants/named_caches/pex_root/installed_wheels/33ced1c876f6a26e7899615a5a4efef2167c263488837c7beed023a64cebd051/PyQt5-5.15.6-cp36-abi3-macosx_10_13_x86_64.whl/PyQt5/QtWidgets.abi3.so
Reason: image not found
It looks like that requires understanding how RPATH works on Mac for a start.bland-father-19717
05/14/2022, 9:25 AM