libigl-python-bindings icon indicating copy to clipboard operation
libigl-python-bindings copied to clipboard

ModuleNotFoundError: No module named 'igl.pyigl'

Open JonathanPham opened this issue 3 years ago • 7 comments

Hi,

I installed the source code via python setup.py install. But, when I ran import igl in Python, I got the error ModuleNotFoundError: No module named 'igl.pyigl'. It seems like the issue is coming from the command, from .pyigl import *, in libigl-python-bindings/igl/__init__.py.

Any recommendations on how to resolve this? Am I importing igl incorrectly in Python?

Thanks!

JonathanPham avatar Dec 02 '21 02:12 JonathanPham

Also met the same error. Installing in a conda environment within a nivdia docker via python setup.py install.

I resolved this error by:

$ git clone https://github.com/libigl/libigl-python-bindings.git
$ cd libigl-python-bindings
$ conda activate igl # with python, pip, numpy and scipy installed in this env
$ python setup.py install # if this step success, you should get a new directory named build
$ export CONDA_HOME=/data/miniconda3 # specify your conda home directory
$ cp -r ./build/lib.linux-x86_64-3.8/igl ${CONDA_HOME}/envs/igl/lib/python3.8/site-packages/

Now you should be able to import igl with no error. However, I don't know why this works and wonder if anyone can provide more elegant solutions, thanks.

fyviezhao avatar Dec 06 '21 03:12 fyviezhao

@teseoch Hi, would you please consider to release v2.2.2 version of conda libigl package? I'm working on a 2D bbw project, and have to install libigl via python setup.py install since the current v2.2.1 conda package had not fixed the 2D bbw assertion bug reported in #90. However, compiling libigl from scratch is error-prone as commented above. I'd appreciate if you could release a new conda version, which I believe will save my day and others who need 2D bbw.

fyviezhao avatar Dec 06 '21 08:12 fyviezhao

I have also run into this error (whether I use a conda install or try and install from the source code). Unfortunately, the solution proposed above doesn't work for me, even though I am also working on a linux system. Any suggestions?

dawnfinzi avatar Apr 07 '22 20:04 dawnfinzi

Also running into trouble with this currently - installed through conda, python 3.8.

kampelmuehler avatar Apr 19 '22 08:04 kampelmuehler

I don't know why but the libraries were not copied after in the imported igl directory after I did python setup.py install. To fix that issue, I had to manually copy them. In my case:

cp build/lib.macosx-11.1-arm64-3.9/igl/*.so igl

ntraut avatar Aug 30 '22 15:08 ntraut

I have also run into this error (whether I use a conda install or try and install from the source code). Unfortunately, the solution proposed above doesn't work for me, even though I am also working on a linux system. Any suggestions?

hi, have you solve this problem?

dyy0205 avatar Sep 06 '22 02:09 dyy0205

hi, have you solve this problem?

In my case yes, but of course the lib directory can change depending of the architecture.

ntraut avatar Sep 06 '22 18:09 ntraut

I'm hoping this problem may have been solved with the migration to pip (pip install libigl). If this is still an issue, please reopen.

alecjacobson avatar Feb 05 '23 23:02 alecjacobson

Thanks. Copying the compiled files to site-packages solved my issue.

santisy avatar Sep 01 '23 00:09 santisy