PyQt5: Missing

I’m using NVIDIA Jetson Tx2 on Ubuntu 16.04 with Python3. I got a problem about PyQt5.

import PyQt5

That’s OK.

from PyQt5 import QtGui

This will lead to the problem of “ImportError: cannot open shared object file: No such file or directory”.

PyQt5 was installed by apt. And I tried to compile Qt5, it failed. Maybe someone else had installed another Qt version in my device.

make[7]: Leaving directory '/home/nvidia/qt/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl'
make[6]: Leaving directory '/home/nvidia/qt/qtbase/src/plugins/platforms/xcb/gl_integrations'
make[5]: Leaving directory '/home/nvidia/qt/qtbase/src/plugins/platforms/xcb'
make[4]: Leaving directory '/home/nvidia/qt/qtbase/src/plugins/platforms'
make[3]: Leaving directory '/home/nvidia/qt/qtbase/src/plugins'
Makefile:693: recipe for target 'sub-plugins-make_first' failed
make[2]: *** [sub-plugins-make_first] Error 2
make[2]: Leaving directory '/home/nvidia/qt/qtbase/src'
Makefile:48: recipe for target 'sub-src-make_first' failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory '/home/nvidia/qt/qtbase'
Makefile:83: recipe for target 'module-qtbase-make_first' failed
make: *** [module-qtbase-make_first] Error 2

Do you have this file? “ls /usr/lib/aarch64-linux-gnu/*”.


If not, do you show a package from:

dpkg -l | grep libqt5gui5

If you have that, then probably you need to tell the package where to find it. If not, then you need to install libqt5gui5.

Hello linuxdev,

I just copied the Qt5 dynamic library from another Jetson TX2 and set the environment. It works. Thanks a lot!

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/nvidia/libQt5/QT5-LIB/

I ran into a very similar problem with the same error message. First, debug some by turning on


from the linux command line and rerun the application. For me this revealed the following:

“Cannot load library /home/…/miniconda3/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/ ( cannot open shared object file: No such file or directory)”

“Cannot load library /home/…/miniconda3/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/ ( cannot open shared object file: No such file or directory)”

It’s also useful to ldd the dysfunctional .so file. Ex:

>ldd /home/.../miniconda3/lib/python3.7/site-packages/PyQt5/Qt/plugins/platforms/

Indeed, I was missing and Next, check your architecture using dpkg from the linux command line. (For me, the command “arch” gave a different and unhelpful result)

dpkg --print-architecture #result for me: amd64

I then googled “ ubuntu 18.04 amd64”, and likewise for, which yields those packages on That told me, in retrospect unsurprisingly, I’m missing packages called libxkbcommon-x11-0 and libxkbcommon-0, and that installing those packages will include the needed files, but the dev versions will not. Then the solution:

sudo apt-get update
sudo apt-get install libxkbcommon0
sudo apt-get install libxkbcommon-x11-0