1

I'm working on a computer with CentOS 8. To execute a python module, I've created a virtual environment with python3.9 -m venv venv and activated it with source venv/bin/activate. After installing the dependencies with pip 21.3.1, I'm getting the following error when I try to import QtWebEngineWidgets.

(venv) [user@localhost myprog]$ python3 -c "from PyQt5 import QtWebEngineWidgets"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: libQt5QmlModels.so.5: cannot open shared object file: No such file or directory

However, when I look in the site-packages directory of the virtual environment, the file exists.

(venv) [user@localhost myprog]$ find venv/lib64/python3.9/site-packages/* -name "libQt5QmlModels*"
venv/lib64/python3.9/site-packages/PyQt5/Qt5/lib/libQt5QmlModels.so.5
venv/lib64/python3.9/site-packages/qt5_applications/Qt/lib/libQt5QmlModels.so.5

The output using `QT_DEBUG_PLUGINS=1" is the same as without:

(venv) [user@localhost myprog]$ QT_DEBUG_PLUGINS=1 python3 -c "from PyQt5 import QtWebEngineWidgets"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: libQt5QmlModels.so.5: cannot open shared object file: No such file or directory

Further details:

  • If I install the modules PyQt5, PyQt5-sip and QtWebEngineWidgets outside of the virtual environment, the import works without problems (outside of the venv).
  • Using other python versions for the virtual environment (tested: 3.6, 3.8) the problem doesn't appear either

What am I doing wrong? Why can't the libQt5QmlModels.so.5 be found?

I've read a question with the same title but it didn't help, since I've already installed/upgraded the modules listed in the solution.

Robe
  • 343
  • 5
  • 10

0 Answers0