ImportError /usr/lib64/libQt5Core.so.5 - in several software packages

Hello,

I am trying to run some software, including Cadence, that seemingly relies on Qt.

In the shell, I get this response, from Cadence and other software:

ImportError: /lib64/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /usr/local/lib/python3.10/site-packages/PyQt5-5.15.6-py3.10-linux-x86_64.egg/PyQt5/QtCore.abi3.so)

I noted LD_LIBRARY_PATH is not set by .bash_profile anymore after upgrade to Fedora 31 - but that does not seem to address my issue. I have this file: /usr/lib64/libQt5Core.so.5 and

echo $LD_LIBRARY_PATH

gets me:

/usr/lib64/:

So, my question is: how can I fix this error.

First, please remove any customization you made in .bashrc, .bash_profile, or anywhere else that customized your LD_LIBRARY_PATH like with export LD_LIBRARY_PATH=/to/dir/path.

Log out and login again to make sure your session correctly reload the environment variable.

Then run ldconfig -p | grep "libQt5Core.so.5". Check if you have the result as below:

$ ldconfig -p |  grep "libQt5Core.so.5"
libQt5Core.so.5 (libc6,x86-64, OS ABI: Linux 3.17.0) => /lib64/libQt5Core.so.5

If the result is empty, delete ld cache file sudo rm /etc/ld.so.cache then regenerate again with sudo ldconfig.

Check again with ldconfig -p | grep "libQt5Core.so.5".

1 Like

with

I get

ldconfig -p | grep "libQt5Core.so.5"
	libQt5Core.so.5 (libc6,x86-64, OS ABI: Linux 3.17.0) => /lib64/libQt5Core.so.5

but the error message continues to be

File "/usr/share/cadence/src/cadence.py", line 25, in <module>
    from PyQt5.QtCore import QFileSystemWatcher, QThread, QSemaphore
ImportError: /usr/lib64/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /usr/local/lib/python3.10/site-packages/PyQt5-5.15.6-py3.10-linux-x86_64.egg/PyQt5/QtCore.abi3.so)

and if rename the library /lib64/libQt5Core.so.5 for testing purpose to /lib64/libQt5Core-sec.so.5
then I get

ImportError: libQt5Core.so.5: cannot open shared object file: No such file or directory

Try to reinstall sudo dnf reinstall python3-pyqt5-sip.

Btw, I tried on Fedora 35 Workstation with sudo dnf install Cadence with capital C is working fine. Maybe you could also try sudo dnf distro sync to find if there any missing packages during the installation.

1 Like

Thanks for the suggestions!

and then running cadence gets me still the same error

ImportError: /lib64/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /usr/local/lib/python3.10/site-packages/PyQt5-5.15.6-py3.10-linux-x86_64.egg/PyQt5/QtCore.abi3.so)

And

gets me

Nothing to do.

Hi, hopefully you’re not bothered by me replying again.

I just realize that directory /usr/local/lib/python3.10/* only present if we install Python package manually (etc. download and install from https://www.python.org/downloads/).

I’m not sure, but there maybe conflict happening in your system since Fedora 35 it self I believe have already installed (shipped with) Python 3 by default.

If you still interest repairing your app, I tried to run dnf repoquery /usr/bin/cadence --deplist and get result below as dependencies.

Click to show the dependencies
package: Cadence-1.0.0-0.17.20210316gitc146ff9.fc35.x86_64
  dependency: /usr/bin/bash
   provider: bash-5.1.8-2.fc35.x86_64
  dependency: /usr/bin/python3
   provider: python3-3.10.0-1.fc35.i686
   provider: python3-3.10.0-1.fc35.x86_64
  dependency: /usr/bin/sh
   provider: bash-5.1.8-2.fc35.x86_64
  dependency: a2jmidid
   provider: a2jmidid-9-6.fc35.x86_64
  dependency: glibc >= 2.33.9000-43.fc35
   provider: glibc-2.34-11.fc35.i686
   provider: glibc-2.34-11.fc35.x86_64
  dependency: hicolor-icon-theme
   provider: hicolor-icon-theme-0.17-11.fc35.noarch
  dependency: jack_capture
   provider: jack_capture-0.9.73-10.fc35.x86_64
  dependency: libQt5Core.so.5()(64bit)
   provider: qt5-qtbase-5.15.2-30.fc35.x86_64
  dependency: libQt5Core.so.5(Qt_5)(64bit)
   provider: qt5-qtbase-5.15.2-30.fc35.x86_64
  dependency: libQt5Core.so.5(Qt_5.15)(64bit)
   provider: qt5-qtbase-5.15.2-30.fc35.x86_64
  dependency: libQt5Gui.so.5()(64bit)
   provider: qt5-qtbase-gui-5.15.2-30.fc35.x86_64
  dependency: libQt5Gui.so.5(Qt_5)(64bit)
   provider: qt5-qtbase-gui-5.15.2-30.fc35.x86_64
  dependency: libQt5Widgets.so.5()(64bit)
   provider: qt5-qtbase-gui-5.15.2-30.fc35.x86_64
  dependency: libQt5Widgets.so.5(Qt_5)(64bit)
   provider: qt5-qtbase-gui-5.15.2-30.fc35.x86_64
  dependency: libc.so.6(GLIBC_2.34)(64bit)
   provider: glibc-2.34-11.fc35.x86_64
  dependency: libgcc_s.so.1()(64bit)
   provider: libgcc-11.2.1-7.fc35.x86_64
  dependency: libgcc_s.so.1(GCC_3.0)(64bit)
   provider: libgcc-11.2.1-7.fc35.x86_64
  dependency: libgcc_s.so.1(GCC_3.3.1)(64bit)
   provider: libgcc-11.2.1-7.fc35.x86_64
  dependency: libstdc++.so.6()(64bit)
   provider: libstdc++-11.2.1-7.fc35.x86_64
  dependency: libstdc++.so.6(CXXABI_1.3)(64bit)
   provider: libstdc++-11.2.1-7.fc35.x86_64
  dependency: libstdc++.so.6(GLIBCXX_3.4)(64bit)
   provider: libstdc++-11.2.1-7.fc35.x86_64
  dependency: libstdc++.so.6(GLIBCXX_3.4.29)(64bit)
   provider: libstdc++-11.2.1-7.fc35.x86_64
  dependency: python3-qt5
   provider: python3-qt5-5.15.6-1.fc35.i686
   provider: python3-qt5-5.15.6-1.fc35.x86_64
  dependency: rtld(GNU_HASH)
   provider: glibc-2.34-11.fc35.i686
   provider: glibc-2.34-11.fc35.x86_64

From above list, the dependencies you need are anything listed with word provider: *. You could reinstall it all especially that mentioning *qt*, *lib*, and *python* and hopefully it will overwrite the change made by custom python installation.

1 Like

I am very grateful for your effort!

Actually, I am not aware of a manual install of Python; I just reinstalled my system afresh.

Unfortunately, this did not help.
I also tried running Cadence from another user account. No change.

Hm, ls -l /usr/lib64/libQt5Co* gets me:

lrwxrwxrwx. 1 root root      26 Dec  6 16:47 /usr/lib64/libQt5Concurrent.so.5 -> libQt5Concurrent.so.5.15.2
lrwxrwxrwx. 1 root root      26 Dec  6 16:47 /usr/lib64/libQt5Concurrent.so.5.15 -> libQt5Concurrent.so.5.15.2
-rwxr-xr-x. 1 root root   33992 Dec  6 16:52 /usr/lib64/libQt5Concurrent.so.5.15.2
lrwxrwxrwx. 1 root root      20 Dec  6 16:47 /usr/lib64/libQt5Core-sec.so.5 -> libQt5Core.so.5.15.2
-rwxr-xr-x. 1 root root 5952080 Dec  6 16:52 /usr/lib64/libQt5Core-sec.so.5.15.2
lrwxrwxrwx. 1 root root      20 Dec  6 16:47 /usr/lib64/libQt5Core.so.5 -> libQt5Core.so.5.15.2
lrwxrwxrwx. 1 root root      20 Dec  6 16:47 /usr/lib64/libQt5Core.so.5.15 -> libQt5Core.so.5.15.2
-rwxr-xr-x. 1 root root 5952080 Dec  6 16:52 /usr/lib64/libQt5Core.so.5.15.2

where the sec files are just backups (I had removed libQt5Core.so.5* to then reinstall the packages)

ok, I also looked for help at fedora - ImportError /usr/lib64/libQt5Core.so.5 - in several software packages - Unix & Linux Stack Exchange and a comment got me on the right track. I traced back the issue to another package that had installed PyQt at an unexpected place.

The solution was to remove the other package and its dependencies. Then reinstalling Cadence worked and it ran.