ERROR: Could not build wheels for triangle
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.
Hi, please can you let me know what OS & Python version this is in?
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.
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.
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.