PyMeshLab
PyMeshLab copied to clipboard
libQt5Core.so.5: version `Qt_5.15' not found
Importing pymeshlab throws the following import error
"ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found"
even though the file libQt5Core.so.5 exists in the specified path
System : Ubuntu 18.04.6 LTS Steps to reproduce: pip3 install pymeshlab python import pymeshlab
Which python version are you using? Ubuntu 18.04 is shipped with python 3.6 which reached its end of life, and therefore it is not supported by pymeshlab anymore.
hi I use ubuntu 16.04 , and python 3.8 , have the same issue.
Same issue here.
# python --version
Python 3.8.10
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
# pip3 show pymeshlab
Name: pymeshlab
Version: 2022.2.post2
Summary: A Python interface to MeshLab
Home-page: https://github.com/cnr-isti-vclab/PyMeshLab
Author: Alessandro Muntoni, Paolo Cignoni
Author-email: [email protected]
License: GPL3
Location: /usr/local/lib/python3.8/dist-packages
Requires: numpy
Required-by:
# python
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymeshlab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/pymeshlab/__init__.py", line 12, in <module>
from .pmeshlab import *
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /usr/local/lib/python3.8/dist-packages/pymeshlab/pmeshlab.cpython-38-x86_64-linux-gnu.so)
# ls -la /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
lrwxrwxrwx 1 root root 20 Jan 5 2022 /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 -> libQt5Core.so.5.12.8
My guess is the intent is to be linking against the packaged version of this library and not the system version:
# ls -la /usr/local/lib/python3.8/dist-packages/pymeshlab/lib/libQt5Core.so.5
-rwxr-xr-x 1 root staff 7070064 Sep 3 17:56 /usr/local/lib/python3.8/dist-packages/pymeshlab/lib/libQt5Core.so.5
Is it possible to peg against the system library instead of the package version?
This issue has been automatically marked as stale because it has not had recent activity. The resources of the VCLab team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the last release of PyMeshLab, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
@fgbxx ubuntu 16.04 reached its end of life, and it is not supported, sorry about that. @yamokosk I agree, it seems that looks first for the system one (which in ubuntu 20.04, if it's installed, is Qt 5.12) and then for the packaged one. And that's not ok... I'll look into this.
@yamokosk I actually cannot replicate your issue.
I set up a clean ubuntu 20.04 machine where I installed python, pymeshlab and qt5-default, and pymeshlab is correctly loaded.
Also, it seems to me that the pmeshlab
module looks for Qt first into pymeshlab/lib
.
This is the output of readelf -d pmeshlab.cpython-38-x86_64-linux-gnu.so
:
Dynamic section at offset 0x5c9f8 contains 34 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libmeshlab-common.so]
0x0000000000000001 (NEEDED) Shared library: [libpython3.8.so.1.0]
0x0000000000000001 (NEEDED) Shared library: [libQt5OpenGL.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Widgets.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Gui.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Core.so.5]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/lib]
[...]
could you please paste your output and the output of ldd pmeshlab.cpython-38-x86_64-linux-gnu.so
?
Hi, I have the same problem, trying to use pymeshlab in a docker container. My output of ldd pmeshlab.cpython-38-x86_64-linux-gnu.so
is:
user@1d96476c763a:/workspace$ ldd /home/user/.local/lib/python3.8/site-packages/pymeshlab/pmeshlab.cpython-38-x86_64-linux-gnu.so
linux-vdso.so.1 (0x00007ffd23178000)
libmeshlab-common.so => /home/user/.local/lib/python3.8/site-packages/pymeshlab/lib/libmeshlab-common.so (0x00007f5244187000)
libpython3.8.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0 (0x00007f5243c31000)
libQt5OpenGL.so.5 => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 (0x00007f5243bd5000)
libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f524353a000)
libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f5242f4f000)
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f5242713000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5242531000)
libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007f52423e2000)
libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f52423c7000)
libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007f52421d5000)
libQt5Xml.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007f5242193000)
libexternal-glew.so => /home/user/.local/lib/python3.8/site-packages/pymeshlab/lib/libexternal-glew.so (0x00007f5241ede000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f5241e56000)
libexpat.so.1 => /usr/lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f5241e28000)
libz.so.1 => /usr/lib/x86_64-linux-gnu/libz.so.1 (0x00007f5241e0c000)
libpthread.so.0 => /usr/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5241de9000)
libdl.so.2 => /usr/lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5241de3000)
libutil.so.1 => /usr/lib/x86_64-linux-gnu/libutil.so.1 (0x00007f5241ddc000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f5241da4000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f5241ca0000)
libicui18n.so.66 => /usr/lib/x86_64-linux-gnu/libicui18n.so.66 (0x00007f52419a1000)
libicuuc.so.66 => /usr/lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f52417bb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5244693000)
libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f5241701000)
libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f52416cd000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f52415a4000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f52414e5000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f52414b8000)
libicudata.so.66 => /usr/lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f523f9f5000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f523f8b8000)
libpcre.so.3 => /usr/lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f523f845000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f523f81b000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f523f815000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f523f80b000)
libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f523f7f1000)
And output of readelf -d pmeshlab.cpython-38-x86_64-linux-gnu.so
:
Dynamic section at offset 0x5c9f8 contains 34 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libmeshlab-common.so]
0x0000000000000001 (NEEDED) Shared library: [libpython3.8.so.1.0]
0x0000000000000001 (NEEDED) Shared library: [libQt5OpenGL.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Widgets.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Gui.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Core.so.5]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/lib]
Hope this helps to identify the issue. Thanks.
Hi @Zunhammer, could you please check if the issue still persists with this wheel? I am still not able to replicate the issue, I don't know how to set up an environment where it occurs.
Hi @alemuntoni, thanks for your feedback. I rebuilt my docker image and currently I'm not facing any issue with libQt5 anymore. Seems fixed to me.
I ran into this same error inside a 20.04-based docker image. I have pymeshlab==2022.2.post2
which is the latest release at time of writing. @alemuntoni maybe pymeshlab
could hide the QT / binary-related imports? it would be helpful if this crash only happened when the user tried to use broken functionality versus if some dependent project happens to install and import but not use pymeshlab
(my case).
the exact error I get:
$ python3 -c 'import pymeshlab'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/user/.local/lib/python3.8/site-packages/pymeshlab/__init__.py", line 11, in <module>
from .pmeshlab import *
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/user/.local/lib/python3.8/site-packages/pymeshlab/pmeshlab.cpython-38-x86_64-linux-gnu.so)
I tried this but now I get a different error:
apt-get update && apt-get install -y software-properties-common && apt-get update && add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
apt-get install qt515base
source /opt/qt515/bin/qt515-env.sh
$ python3 -c 'import pymeshlab'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/user/.local/lib/python3.8/site-packages/pymeshlab/__init__.py", line 11, in <module>
from .pmeshlab import *
ImportError: /home/user/.local/lib/python3.8/site-packages/pymeshlab/lib/libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5
This doesn't work either :(
QT_PLUGIN_PATH=/home/user/.local/lib/python3.8/site-packages/pymeshlab/lib/ python3 -c 'import pymeshlab'
I can reproduce the problem, too. It appears that something is broken in the way PyMeshLab searches for available Qt.
Here's on an HPC cluster.
-
Create a fresh Anaconda environment
module --force purge module load anaconda/2020.11-py38 conda create -n myPyMeshLab -y python=3.9 pip conda activate myPyMeshLab
-
Install Qt into the environment, check installed version
conda install -y qt pyqt qtpy conda list | grep qt pyqt 5.15.7 py39h6a678d5_1 pyqt5-sip 12.11.0 py39h6a678d5_1 qt-main 5.15.2 h327a75a_7 qt-webengine 5.15.9 hd2b0992_4 qtpy 2.2.0 py39h06a4308_0 qtwebkit 5.212 h4eab89a_4
-
Install PyMeshLab
# Using 'python3 -m pip' rather than pip3, because safer. python3 -m pip install --no-cache-dir pymeshlab
-
And test
python -c 'import pymeshlab' Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/lev/.conda/envs/cent7/2020.11-py38/myPyMeshLab/lib/python3.9/site-packages/pymeshlab/__init__.py", line 11, in <module> from .pmeshlab import * ImportError: /apps/spack/gilbreth/apps/anaconda/2020.11-py38-gcc-4.8.5-djkvkvk/lib/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/lev/.conda/envs/cent7/2020.11-py38/myPyMeshLab/lib/python3.9/site-packages/pymeshlab/pmeshlab.cpython-39-x86_64-linux-gnu.so)
Note the strange thing: I have Qt 5.15 inside of my activated environment (under /home/lev/.conda/envs/....
). But contrary to the expected behavior, pmeshlab.cpython-39-x86_64-linux-gnu.so completely ignores that Qt, and insists on grabbing one from the base environment instead (underneath /apps/spack/gilbreth/apps/anaconda/....
)
Tested and reproduced with environment pythons 3.8, 3.9 and 3.11 (and corresponding PyMeshLab v2022.2.post3 wheels).
Hi @alemuntoni, thanks for your feedback. I rebuilt my docker image and currently I'm not facing any issue with libQt5 anymore. Seems fixed to me.
Hi @alemuntoni , would you mind sharing your Dockerfile which is working? Thank you!
I am also running into the same issue. This occurs inside fresh Conda envs, with any Python version I tested (3.7, 3.8, 3.9). Seems same as seen by @lgorenstein .
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
$ pip show pymeshlab
Name: pymeshlab
Version: 2022.2.post4
$ python
Python 3.9.17 (main, Jul 5 2023, 20:41:20)
[GCC 11.2.0] :: Anaconda, Inc. on linux
>>> import pymeshlab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zotgiann/miniconda3/envs/testpy39/lib/python3.9/site-packages/pymeshlab/__init__.py", line 11, in <module>
from .pmeshlab import *
ImportError: /home/zotgiann/miniconda3/envs/testpy39/lib/python3.9/site-packages/pymeshlab/lib/libmeshlab-common.so: undefined symbol: qt_version_tag, version Qt_5.15
Conda is not supported by PyMeshLab.
Hi @alemuntoni, thanks for your feedback. I rebuilt my docker image and currently I'm not facing any issue with libQt5 anymore. Seems fixed to me.
Hi @alemuntoni , would you mind sharing your Dockerfile which is working? Thank you!
I don't have a Dockerfile. We use the default runners provided by github actions.
In Conda environment,I solved this problem with the following instruction.
export LD_LIBRARY_PATH=/home/{username}/miniconda3/envs/{env_name}/lib/python3.8/site-packages/pymeshlab/lib/
I have the same issue when using pymeshlab inside a venv:
the system QT version is 5.12.8:
ldconfig -v | grep libQt5Core
libQt5Core.so.5 -> libQt5Core.so.5.12.8
and when I import pymeshlab I get:
ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version Qt_5.15 not found (required by /home/{username}/.local/{env_name}/lib/python3.8/site-packages/pymeshlab/pmeshlab.cpython-38-x86_64-linux-gnu.so)
Setting the LD_LIBRARY_PATH
like suggested by @Guangyun-Xu works, but shouldn't pymeshlab make sure to use the libraries, delivered with the wheel? For win32 there is code to handle this:
https://github.com/cnr-isti-vclab/PyMeshLab/blob/7cd6a0b7bc18b7ffb8a0e8f2b10b4d3f55f9121e/pymeshlab/init.py#L5-L9
but shouldn't pymeshlab make sure to use the libraries, delivered with the wheel?
It does. If you take any wheel, unzip it and look at the rpath of the module with readelf -d pmeshlab.cpython*.so |head -20
, you get:
Dynamic section at offset 0x87a10 contains 34 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libmeshlab-common.so]
0x0000000000000001 (NEEDED) Shared library: [libpython3.10.so.1.0]
0x0000000000000001 (NEEDED) Shared library: [libQt5OpenGL.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Widgets.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Gui.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Core.so.5]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/lib/]
0x000000000000000c (INIT) 0x10000
0x000000000000000d (FINI) 0x69120
0x0000000000000019 (INIT_ARRAY) 0x87818
0x000000000000001b (INIT_ARRAYSZ) 16 (bytes)
0x000000000000001a (FINI_ARRAY) 0x87828
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
Same if you run it on any of the plugins:
Dynamic section at offset 0x4aab8 contains 32 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libmeshlab-common.so]
0x0000000000000001 (NEEDED) Shared library: [libQt5Widgets.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Gui.so.5]
0x0000000000000001 (NEEDED) Shared library: [libQt5Core.so.5]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN/../]
0x000000000000000c (INIT) 0x11000
0x000000000000000d (FINI) 0x3e6d8
0x0000000000000019 (INIT_ARRAY) 0x4b148
0x000000000000001b (INIT_ARRAYSZ) 48 (bytes)
0x000000000000001a (FINI_ARRAY) 0x4b178
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x553c0
0x0000000000000005 (STRTAB) 0x4d000
As far as I know, this should be enough on linux. Any clue?
@alemuntoni Thank you for looking into the matter. You're right, the libraries are set up correctly. In my case, the culprit was another Python package that I imported before pymeshlab, which messed up the path. After an update of the other package everything works fine now.