Building wheel for mathutils (setup.py) ... error
Thanks for your amazing work. However, an error occurs during the building of the mathutils package when running python setup.py bdist_wheel. The compilation fails due to an incompatible function call in the mathutils.c file. Specifically, the function _Py_HashDouble is called with two arguments, whereas it expects only a single double argument. This mismatch results in a gcc compilation error. So which version of mathutils package should be used ?
same issue here
Problem Origin: The error occurs when compiling mathutils with Python 3.9 in a Linux environment (e.g., WSL2). Specifically, the function _Py_HashDouble in src/mathutils/mathutils.c is called with two arguments (NULL and a double), but in Python 3.9, it expects only one argument (a double). This mismatch causes a compilation failure during the installation process.
Solution: To resolve this, download the mathutils source code, modify the problematic line to match Python 3.9’s API, and install it manually. Use the following steps:
pip download mathutils==3.3.0 --no-binary :all:
tar -xzf mathutils-3.3.0.tar.gz
cd mathutils-3.3.0
sed -i '79s/_Py_HashDouble(NULL,/_Py_HashDouble(/' src/mathutils/mathutils.c
cat -n src/mathutils/mathutils.c | grep -A 1 -B 1 " 79 "
python setup.py install