In [1]: import pymeshlab
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import pymeshlab
File /opt/conda/lib/python3.10/site-packages/pymeshlab/__init__.py:11
8 os.environ['QT_PLUGIN_PATH'] = this_path
9 os.environ['PATH'] = this_path + os.pathsep + os.environ['PATH']
---> 11 from .pmeshlab import *
12 from .replacer import replace_pymeshlab_filter_names
13 from .polyscope_functions import show_polyscope
ImportError: /opt/conda/lib/python3.10/site-packages/pymeshlab/lib/libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5
qt5 installed is PyQt5-Qt5-5.15.2
I ran into the same error libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5
Running the following before my python script fixed it:
export LD_LIBRARY_PATH=~/.conda/envs/<ENV_NAME>/lib/python3.9/site-packages/pymeshlab/lib/:$LD_LIBRARY_PATH
A critical detail: :$LD_LIBRARY_PATH
needs to come after the .../pymeshlab/lib/
path. If you do it the other way around, i.e. $LD_LIBRARY_PATH:~/.conda/envs/...
then it will cause the same error (presumably because the pymeshlab lib needs to be searched first).
@ArmanMaesumi that fix does help, however I get different behavior depending on whether I'm trying to import pymeshlab from a Jupyter notebook or from a python script
In the python script everything goes through fine
In the jupyter notebook I get the same error:
ImportError: /media/xallt/HardDrive/.virtualenv/python38/lib/python3.8/site-packages/pymeshlab/lib/libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5
i.e. I still cant import it in the notebook
@ArmanMaesumi that fix does help, however I get different behavior depending on whether I'm trying to import pymeshlab from a Jupyter notebook or from a python script In the python script everything goes through fine In the jupyter notebook I get the same error: ImportError: /media/xallt/HardDrive/.virtualenv/python38/lib/python3.8/site-packages/pymeshlab/lib/libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5
i.e. I still cant import it in the notebook
@Xallt
I would suggest googling around for "LD_LIBRARY_PATH not working in jupyter notebook"
It seems like there are some relevant threads: jupyter/notebook#1290 (comment)
Note that, the solution in that thread suggests overriding the environment variable, whereas my suggestion concatenates to it. You can try both and see if it works
And somehow I fix it by doing:
pip remove pyqt (!!! I wonder if this one is needed, havent try it again !!!)
pip install pyqt5
Because I found out that pyqt and pyqt5 is different and when I list my installed package I cant find pyqt5
I ran into the same error libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5
Running the following before my python script fixed it:
export LD_LIBRARY_PATH=~/.conda/envs/<ENV_NAME>/lib/python3.9/site-packages/pymeshlab/lib/:$LD_LIBRARY_PATH
A critical detail: :$LD_LIBRARY_PATH
needs to come after the .../pymeshlab/lib/
path. If you do it the other way around, i.e. $LD_LIBRARY_PATH:~/.conda/envs/...
then it will cause the same error (presumably because the pymeshlab lib needs to be searched first).
IT WORKS!