PyMeshLab icon indicating copy to clipboard operation
PyMeshLab copied to clipboard

libQt5Core.so.5: version `Qt_5.15' not found

Open praveen5733 opened this issue 2 years ago • 3 comments

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

praveen5733 avatar Jun 10 '22 14:06 praveen5733

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.

alemuntoni avatar Jun 28 '22 09:06 alemuntoni

hi I  use ubuntu 16.04 , and python 3.8 , have the same issue.

fgbxx avatar Aug 25 '22 07:08 fgbxx

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?

yamokosk avatar Sep 03 '22 18:09 yamokosk

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.

stale[bot] avatar Nov 12 '22 02:11 stale[bot]

@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.

alemuntoni avatar Dec 07 '22 09:12 alemuntoni

@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?

alemuntoni avatar Dec 07 '22 15:12 alemuntoni

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.

Zunhammer avatar Dec 09 '22 15:12 Zunhammer

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.

alemuntoni avatar Jan 09 '23 12:01 alemuntoni

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.

Zunhammer avatar Jan 09 '23 19:01 Zunhammer

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'

pwais avatar Feb 26 '23 23:02 pwais

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.

  1. 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
    
  2. 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
    
  3. Install PyMeshLab

    # Using 'python3 -m pip'  rather than pip3, because safer.
    python3 -m pip install --no-cache-dir pymeshlab
    
  4. 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).

lgorenstein avatar Apr 05 '23 01:04 lgorenstein

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!

yuyingyeh avatar Jul 20 '23 18:07 yuyingyeh

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

tommasogiannantonio avatar Jul 21 '23 08:07 tommasogiannantonio

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.

alemuntoni avatar Jul 21 '23 08:07 alemuntoni

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/

Guangyun-Xu avatar Jan 22 '24 12:01 Guangyun-Xu

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

kielnino avatar Jan 26 '24 10:01 kielnino

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 avatar Jan 26 '24 10:01 alemuntoni

@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.

kielnino avatar Jan 31 '24 08:01 kielnino