PyQt5 not finding installed Qt5 library

限于喜欢 提交于 2019-12-24 08:13:02

问题


On Ubuntu 16.0.4, I am trying to run this PyQt5 script, and I have the distributed packages for Qt5 (via apt) and PyQt5 (via pip3) installed.

Error:

sudo ./video_qt.py

Traceback (most recent call last): File "./video_qt.py", line 8, in from PyQt5 import QtWidgets, QtCore ImportError: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not >found (required by /usr/local/lib/python3.5/dist-packages/PyQt5/QtWidgets.so)

But it is there:

ls /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5

/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5

What could be going on here?


回答1:


I do not have ubuntu to check on.

I would guess that the PyQt in PyPI is not compatible with the installed Qt .so files.

Try pip3 uninstall PyQt and install PyQt from apt should get you binaries that work together.

If its not in apt, ask unbuntu to package it or build PyQt from source. Which not that hard to do.



来源:https://stackoverflow.com/questions/39129615/pyqt5-not-finding-installed-qt5-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!