Coder Social home page Coder Social logo

Comments (34)

madalinaraileanu avatar madalinaraileanu commented on June 14, 2024 2

I've had the same problem. After several attempts I realized that the error was due to the PyQt5 version <5.15. I advise you to check the version of PyQt5. Hope to be helpful.

from pymeshlab.

SilviaCaggiari avatar SilviaCaggiari commented on June 14, 2024 1

Here it is:

from PyQt5.QtCore import QPoint, QSize, Qt, QTimer, QRect, pyqtSignal

from PyQt5.QtGui import (QColor, QFontMetrics, QImage, QPainter, QIcon,
                         QOpenGLVersionProfile)

from PyQt5.QtWidgets import (QAction, QApplication, QGridLayout, QHBoxLayout,
                             QMainWindow, QMessageBox, QComboBox, QButtonGroup,
                             QOpenGLWidget, QFileDialog, QLabel, QPushButton,
                             QSlider, QWidget, QTableWidget, QTableWidgetItem,
                             QAbstractButton, QCheckBox, QErrorMessage, QTextEdit, QVBoxLayout)`

If I run the above first, I have a DLL error in importing pymeshlab. if I run pymeshlab first I have this error:

from PyQt5.QtWidgets import QWidget

ImportError: DLL load failed: The specified procedure could not be found.

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

Could you please uninstall it and install it again with:

pip3 install pymeshlab

from pymeshlab.

SilviaCaggiari avatar SilviaCaggiari commented on June 14, 2024

Same error here,
I have uninstalled and installed several times already with the command pip3 install pymeshlab, but same error appears.
Version is now 0.1.8 despite yesterday I installed 0.1.7, which worked at some point.
Any possibile solution?

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

I don't know where to start to investigate on this issue. We have tests running as expected on Windows.

I see something strange about the fact that pymeshlab is installed in an Anaconda environment:

File "C:\Users\mutiargob\Anaconda3\lib\site-packages\pymeshlab_init_.py", line 1, in
from .pmeshlab import *

This could happen if pip has been installed through anaconda, I guess..

@SilviaCaggiari do you see something similar in your prompt?

from pymeshlab.

SilviaCaggiari avatar SilviaCaggiari commented on June 14, 2024

Yes, I reckon all and I'm running Anaconda as well.
I think there is a conflict somewhere, presumably with pyqt5 also .
I just discovered If I run "import pymeshlab" in a new file, this perfectly works, but if I start importing other libraries, depending on what I run first, I have a corresponding DLL error.
Hope this helps you in investigating

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

It points in the right direction!
Could you please share a portion of script that causes the issue?

from pymeshlab.

BismaMutiargo avatar BismaMutiargo commented on June 14, 2024

i realise that this may be spyder's issue.
when i use anaconda prompt and type

activate [myEnv]
python
and i input:
import pymeshlab

it is successfully doing the import and the following output is shown:
PyMeshLab 0.1.7 based on MeshLab 2020.12d

so I thought that maybe this is just the wrong python path. and so I typed

python -c "import sys; print(sys.executable)"

and then, I tried to change the interpreter by going to spyder tools, and keying in the path

Tools>Preferences>Python interpreter

still doesnt work.

so I gave up and installed jupyter notebook instead of spyder.

and it worked. I'm not sure why though.

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

Ok, I also verified on Windows and it seems related to conda..

I tried running on a clean windows environment this:

from PyQt5.QtCore import QPoint, QSize, Qt, QTimer, QRect, pyqtSignal

from PyQt5.QtGui import (QColor, QFontMetrics, QImage, QPainter, QIcon,
                         QOpenGLVersionProfile)

from PyQt5.QtWidgets import (QAction, QApplication, QGridLayout, QHBoxLayout,
                             QMainWindow, QMessageBox, QComboBox, QButtonGroup,
                             QOpenGLWidget, QFileDialog, QLabel, QPushButton,
                             QSlider, QWidget, QTableWidget, QTableWidgetItem,
                             QAbstractButton, QCheckBox, QErrorMessage, QTextEdit, QVBoxLayout)

import pymeshlab

and it works as expected.

I really don't know what conda does with paths, libraries and so on...

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

Little update: with #61, I added these lines in __init__.py:

this_path=str(pathlib.Path(__file__).parent.absolute())
if platform == 'win32':
os.environ['QT_PLUGIN_PATH']=this_path

which forces python to look for pymeshlab's Qt deployed libraries when importing pymeshlab. It was necessary to make the Qt OpenGL infrastructure work on windows. I don't know if this fix could be related with this issue and if it solves it.
If you can test this in the next pymeshlab version, when it will be released, it would be appreciated :)

from pymeshlab.

stale avatar stale commented on June 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from pymeshlab.

 avatar commented on June 14, 2024

I had a similar issue.
In a conda environment I am not able to run pymeshlab, whereas in a virtualenv pymeshlab works fine.

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

Still I don't know what conda does with PATH in windows, I think that there are conflicts when linking with qt libraries.
pymeshlab contains Qt 5.15 libraries inside its package, and due to linking rules on windows, they should be linked (with all the other libraries contained in the package) when importing pymeshlab. I just don't know how to replicate and how to solve it, sorry.
If someone has some clues, help is really appreciated...

from pymeshlab.

misan avatar misan commented on June 14, 2024

Not using conda in Windows 10 but

>pip3 install pymeshlab Collecting pymeshlab Downloading pymeshlab-2021.7-cp38-cp38-win_amd64.whl (34.2 MB) |████████████████████████████████| 34.2 MB 49 kB/s Requirement already satisfied: numpy in c:\users\misan\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from pymeshlab) (1.19.4) Installing collected packages: pymeshlab Successfully installed pymeshlab-2021.7

would lead to

`>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import pymeshlab
Warning:
Unable to load the following plugins:

    filter_mesh_booleans.dll: filter_mesh_booleans.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\misan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pymeshlab\lib\plugins\filter_mesh_booleans.dll: No se puede encontrar el m?dulo especificado.
filter_sketchfab.dll: filter_sketchfab.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\misan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pymeshlab\lib\plugins\filter_sketchfab.dll: No se puede encontrar el m?dulo especificado.

`

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

filter_mesh_booleans.dll

That's not an error, but a warning. You are able to run pymeshlab, but without two plugins (mesh_booleans and sketchfab).
TBH, I don't know why. Having a 'standard' PATH env variable, pymeshlab will load the plugins using the bundled libraries inside the package.
The two plugins that are failing to load depend on gmp/mpfr and Qt5Network dlls.
Apparently, for some reasons, the dll loader does not find these libraries, or it is loading different versions from some other directories.

from pymeshlab.

misan avatar misan commented on June 14, 2024

Thanks a lot for the clarification Alessandro.

Please let me know if I can help you guys sorting out why these messages pop in Windows (I had not trouble with either Linux or OSX).

I guess I have installed other programs, like MeshLab that for sure use Qt5 so some DLLs could be floating on my system and pop up when another version was expected.

from pymeshlab.

misan avatar misan commented on June 14, 2024

More info. I can see Qt5Network.dll is loaded by two other programs running in my system:

image

And when I see what python.exe loads after doing the import pymeshlab I can see no additional instance of the process loading Qt5Network.dll but I see a few of other Qt5 dlls loaded from the right source:
image

from pymeshlab.

misan avatar misan commented on June 14, 2024

I stop the programs that were using Qt5Network.dll and I double-check now ListDlls.exe tool is no longer finding anyone using that DLL.

Now I open python and import pymeshlab, same result and message. and Qt5Network.dll is not loaded for python process (as it was not loaded before).

Could it be the hook for that dll is missing? All the other pymeshlib Qt-related libs are loaded from the right folder...

from pymeshlab.

misan avatar misan commented on June 14, 2024

The two plugins that are failing to load depend on gmp/mpfr and Qt5Network dlls.
Apparently, for some reasons, the dll loader does not find these libraries, or it is loading different versions from some other directories.

image
I reckon filter_mesh_booleans.dll does not use Qt5Network.dll

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

Yes, Qt5Network dll is only required by filter_sketchfab, and gmp/mpfr are required by filter_mesh_booleans.
These libraries are needed just by plugins, and not by the main pymeshlab framework.
To make these libraries "loadable" from the plugins in windows, there are these lines in the __init__.py:

# for windows we need to tell which Qt libraries use
this_path=str(pathlib.Path(__file__).parent.absolute())
if platform == 'win32':
os.environ['QT_PLUGIN_PATH']=this_path
os.environ['PATH'] = this_path + os.pathsep + os.environ['PATH']

We need to do this because:

  • dlls need to be in a different directory wrt plugins dir;
  • windows is able to load only dlls found in the same dir or in the PATH (no rpath or other mechanisms are allowed)

Therefore, before running pymeshlab, we need to add the pymeshlab directory which contains additional libraries (Qt5Network and gmp/mpfr) required by the plugins in the PATH.

It seems that modifying the PATH as done in __init__.py does not work on some systems, I don't know why...

from pymeshlab.

misan avatar misan commented on June 14, 2024

it seems similar to this report: cnr-isti-vclab/meshlab#1060

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

@misan I don't think it's similar. cnr-isti-vclab/meshlab#1060 seems to be an error related with locale and windows, or vc_redist... Here the issue seems to be more related to not finding some libraries bundled into the pymeshlab package...

from pymeshlab.

misan avatar misan commented on June 14, 2024

@alemuntoni while the dlls Meshlab was unable to load were different in Meshlab#1060, the error message looked the same.

Anyway, I have tested another system with Win10 with no issue whatsoever. The difference between the one I had trouble with and the one that worked flawlessly is the latter uses Python 3.9.4 downloaded from Python.org while the former uses Python 3.8.6 downloaded from the Microsoft store.

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

The message actually does not tell nothing.. It prints "does not seem to be a Qt Plugin" everytime that fails to load a plugin, but causes could be different each time.. It's windows that does not tell anything when something goes wrong in these cases..

About your test, thanks for sharing this info! I don't think it is related with the python version, but the fact that one version was downloaded from the microsoft store could be relevant! I'll try to make some tests!

from pymeshlab.

misan avatar misan commented on June 14, 2024

@alemuntoni I can confirm the issue goes away when I removed the Python downloaded from the Microsoft store and installed the one downloaded from Python.org (on the system I had the issue of not loading certain DLLs).

from pymeshlab.

misan avatar misan commented on June 14, 2024

Now it all loads as it should:

image

I could see only three plugins loaded other DLLs, the two that loaded DLLs from ./lib/plugins were the ones that failed before. The one loading from WINDOWS/SYSTEM did not fail (filter_isoparametrization).

from pymeshlab.

alemuntoni avatar alemuntoni commented on June 14, 2024

Thanks @misan!
Therefore it seems that the python installation from the microsoft store is problematic for some reason...
After googling it, it seems that would be better to use the .exe downloaded from the python website (e.g. when installing python from the store, it is not added to PATH...). I don't think that it's worth to be fixed at all, given all these problems..

In any case, the conda issue still persists, and I still don't know how to fix it. I'm actually not sure if it could be fixed.

from pymeshlab.

JoelSjogren avatar JoelSjogren commented on June 14, 2024

I think I am having the analogous problem under linux. I found this https://stackoverflow.com/questions/61384686/why-symbol-lookup-error-undefined-symbol-when-the-symbol-exists a bit informative.

% ipython
Python 3.9.7 (default, Aug 31 2021, 13:28:12) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pymeshlab
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-c54b031f5c64> in <module>
----> 1 import pymeshlab

~/.local/lib/python3.9/site-packages/pymeshlab/__init__.py in <module>
     10     os.environ['PATH'] = this_path + os.pathsep + os.environ['PATH']
     11 
---> 12 from .pmeshlab import *
     13 
     14 # load all the default plugins in the current PyMeshLab session

ImportError: /home/joel/.local/lib/python3.9/site-packages/pymeshlab/lib/libmeshlab-common.so: undefined symbol: _ZdlPvm, version Qt_5

Note that /home/joel/.local/lib/python3.9/site-packages/pymeshlab/lib contains its own libQt5Core.so.5 and for this file it holds that

% nm -D /home/joel/.local/lib/python3.9/site-packages/pymeshlab/lib/libQt5Core.so.5 |grep _ZdlPvm
00000000003cbae0 T _ZdlPvm@@Qt_5

So it seems like pymeshlab is just having troubles finding this file, one of its own files...

I tried adding the folder to the LD_LIBRARY_PATH variable but without any luck.

I also tried from PyQt5.QtCore import ... and that works iff I have PyQt5 installed separately. In either case, pymeshlab gives the same error.

I am using arch linux by the way.

from pymeshlab.

JoelSjogren avatar JoelSjogren commented on June 14, 2024

Update: A clean install of pymeshlab via pip3 in ubuntu 21.04 in virtualbox does not reproduce my issue.

from pymeshlab.

stale avatar stale commented on June 14, 2024

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.

from pymeshlab.

Kevoyuan avatar Kevoyuan commented on June 14, 2024

I solved this issue by putting the pymeshlab related modul on top of the imports, maybe it has some conflicts with other imports.

from pymeshlab.

brochurethin avatar brochurethin commented on June 14, 2024

the same problem in python3.9 spyder

from pymeshlab.

h11water avatar h11water commented on June 14, 2024

Hi, I had this problem on a fresh windows vm with python (not conda or windows store version) but I was able to fix it with:

pip install msvc-runtime

from pymeshlab.

yzk1111 avatar yzk1111 commented on June 14, 2024

Hi, I try "python .py" on Command-Line Interface on windows and it works.

from pymeshlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.