0

I tried to install pyside6, its installation was successful (Successfully installed pyside6-6.2.4 shiboken6-6.2.4).

But I can't run the "Hello World Program" of PySide6, and when executing from PySide6 import QtCore, QtWidgets, QtGui, error occurs:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libQt6Core.so.6: cannot open shared object file: No such file or directory

P.S.

My python version: 3.8.10; pyside version: 6.2.4; Linux kernel: 4.4.0-19041-Microsoft

Leo Dai
  • 1
  • 2
  • How did you installed PySide and how did you ran your Python file? – ניר Jul 14 '22 at 16:31
  • I followed the procedure the official document ask me to do: executing `pip install pyside6` in venv environment. I also tried again executing `pip install pyside6` out of venv environment. It turns out the same. – Leo Dai Jul 14 '22 at 16:49
  • Does this answer your question? [paraview: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory](https://stackoverflow.com/questions/64588549/paraview-error-while-loading-shared-libraries-libqt5core-so-5-cannot-open-sha) – musicamante Jul 14 '22 at 17:01
  • It seems that the issue can be resolved by using the command in the linked question (using the path to the libQt6Core.so.6), or by upgrading to WSL2. – musicamante Jul 14 '22 at 17:02

1 Answers1

0

Problem Solved by:

strip --remove-section=.note.ABI-tag ~/env/lib/python3.8/sitepackages/PySide6/Qt/lib/libQt6Core.so.6

This problem seemed to result from an outdated kernel (or, underdeveloped wsl kernel). Indeed, update wsl to wsl2 may solve this problem further.

Reference:

  1. Why does PySide6 on GitLab CI result in ImportError?

  2. https://askubuntu.com/questions/1034313/ubuntu-18-4-libqt5core-so-5-cannot-open-shared-object-file-no-such-file-or-dir/1163268#1163268

Leo Dai
  • 1
  • 2