calcam icon indicating copy to clipboard operation
calcam copied to clipboard

ERROR: Could not build wheels for triangle

Open EJCT22 opened this issue 1 year ago • 4 comments

I have this error when trying to install calcam using pip:

triangle/core.c:196:12: fatal error: 'longintrepr.h' file not found #include "longintrepr.h" ^~~~~~~~~~~~~~~ 1 error generated. error: command '/usr/bin/clang' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for triangle Successfully built calcam Failed to build triangle ERROR: Could not build wheels for triangle, which is required to install pyproject.toml-based projects

I tried to create pyenv to solve this but it still did not work.

EJCT22 avatar Apr 09 '24 21:04 EJCT22

Hi, please can you let me know what OS & Python version this is in?

ssilburn avatar Apr 10 '24 12:04 ssilburn

Hi. I am using macOS Sonoma version 14.4.1 and Python3. Although I ended up installing without dependencies using --no-deps. I just needed to install the missing modules after the installation. Now, calcam works well.

EJCT22 avatar Apr 10 '24 13:04 EJCT22

Great, glad you got it working! I'll leave this issue open and put some more explanation here because it might be useful for other users on similar platforms. Are you on an Apple silicon machine by any chance?

Thanks a lot to @pixelifytica for helping me investigate this. As far as we can tell it's probably is specific to Apple silicon machines with Python 3.9+ , so easiest solutions are either to do as @EJCT22 did and install Calcam with --no-deps then install the other missing modules "by hand", or to use Python 3.9 or older on Apple silicon machines.

It looks like this happens because the OSX wheels for triangle on PyPi are only for x86-64, so on Apple silicon pip will try to build triangle from source. However, changes to CPython after v3.9 have broken triangle's build against them, and with Python 3.10 or newer this results in exactly the error above.

ssilburn avatar Apr 10 '24 16:04 ssilburn

Thanks for the explanation. I think that’s why it didn’t work when I used venv with python11. Yes, I am using Apple silicon.

EJCT22 avatar Apr 11 '24 00:04 EJCT22