PyMesh icon indicating copy to clipboard operation
PyMesh copied to clipboard

ImportError: No Module named '_PyMesh'

Open punpongsanon opened this issue 8 years ago • 4 comments

I managed to build and installed PyMesh in Windows and with Python 3.4. After build and install I tried to test with 'python -c "import pymesh; pymesh.test()" as described in the manual (readme.md).

However, I got this error;

Traceback (most recent call last): File "C:\Python\3_4\lib\site-packages\pymesh-0.1-py3.4.egg\pymesh\swig\PyMesh.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Python\3_4\lib\importlib__init__.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 2254, in _gcd_import File "", line 2237, in _find_and_load File "", line 2224, in _find_and_load_unlocked ImportError: No module named '_PyMesh'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\Python\3_4\lib\site-packages\pymesh-0.1-py3.4.egg\pymesh__init__.py", line 18, in from .Mesh import Mesh File "C:\Python\3_4\lib\site-packages\pymesh-0.1-py3.4.egg\pymesh\Mesh.py", line 5, in import PyMesh File "C:\Python\3_4\lib\site-packages\pymesh-0.1-py3.4.egg\pymesh\swig\PyMesh.py", line 21, in PyMesh = swig_import_helper() File "C:\Python\3_4\lib\site-packages\pymesh-0.1-py3.4.egg\pymesh\swig\PyMesh.py", line 20, in swig_import_helper return importlib.import_module('PyMesh') File "C:\Python\3_4\lib\importlib__init.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_PyMesh'

Could you please help, did I do something wrong during installation? (no error during build and install excepted only some unnecessary library).

punpongsanon avatar Aug 20 '16 03:08 punpongsanon

Could you check if the file _PyMesh.so or _PyMesh.dll is present in C:\Python\3_4\lib\site-packages\pymesh-0.1-py3.4.egg\pymesh\lib?

qnzhou avatar Aug 22 '16 15:08 qnzhou

OK, I managed it work in Ubuntu. I found some difficult to install in Windows (maybe because of my skill). The problem that I found is the src_test does not build correctly and _PyMesh.dll does not copy to the correct location.

It is very comfortable when I use Ubuntu ...

punpongsanon avatar Aug 31 '16 04:08 punpongsanon

conda install -c conda-forge pymesh2 It is so simple and useful...

whhamber avatar Jan 16 '21 02:01 whhamber

Duplicate of #141

I didn't try but I think this is the solution. https://github.com/PyMesh/PyMesh/issues/141#issuecomment-461423571

GiantRoot avatar Dec 03 '21 09:12 GiantRoot