M
by mcnill on 7 Aug 2024, edited 22 Mar 2025
#
Hi all,
i'm trying to port one of my CAD scripts to a newer CAD version which is using python3.11.
Since python is embedded, it's a bit awkward to get python dependencies installed.
Until now, i was able to install all IfcOpenShell dependencies except mathutils.
It seems to be necassary to compile it during installtion which fails. Missing C++ compiler, even though i've installed a compiler... Maybe the wrong one?
Is there an other way to install a precompiled version? I need to install the script including all python packages on 30+ machines... Won't ne able to install a compiler on alle those machines.
Any help welcome!
BR
Marcus
M
by Moult on 7 Aug 2024
#
@mcnill Blender comes with mathutils, have you tried just ... stealing that? :)
M
by mcnill on 8 Aug 2024
#
@Moult Thanks for the hint! I've installed Blender 3.6/4.2.
Noe glue where to find the files. Tried to find them but without succes...
A
by Andrej730 on 10 Aug 2024
#
I don't think you can just copy it from Blender, it probably compiled together with some other dlls and loaded in some weird way.
It seems to be necassary to compile it during installtion which fails. Missing C++ compiler, even though i've installed a compiler... Maybe the wrong one?
What error? Can you please share the traceback?
Is there an other way to install a precompiled version? I need to install the script including all python packages on 30+ machines... Won't ne able to install a compiler on alle those machines.
You can compile it once and then share the .pyd between the machines. Maybe it's also distributed elsewhere besides pypi but on pypi mathutils is just a source code without the binaries.
A
by Arv on 12 Aug 2024
#
@mcnill what about mathutils from pypi https://pypi.org/project/mathutils/
A
by Andrej730 on 13 Aug 2024
#
@Arv said:
@mcnill what about mathutils from pypi https://pypi.org/project/mathutils/
It doesn't have the binaries, it's just a source code.
M
by mcnill on 16 Aug 2024
#
@Andrej730 said:
I don't think you can just copy it from Blender, it probably compiled together with some other dlls and loaded in some weird way.
It seems to be necassary to compile it during installtion which fails. Missing C++ compiler, even though i've installed a compiler... Maybe the wrong one?
What error? Can you please share the traceback?
Is there an other way to install a precompiled version? I need to install the script including all python packages on 30+ machines... Won't ne able to install a compiler on alle those machines.
You can compile it once and then share the .pyd between the machines. Maybe it's also distributed elsewhere besides pypi but on pypi mathutils is just a source code without the binaries.
Hi Andrej, thank you for your feedback. I need to check when I'm back in office.
I'm off-desk for holiday.
BR
Marcus
M
by mcnill on 16 Aug 2024
#
@Arv said:
@mcnill what about mathutils from pypi https://pypi.org/project/mathutils/
Hi Arv, thank you also for your feedback. Installing from pypi ends with the same message about missing correct compiler.
I think it's like Andrej said, that on pypi is source code, no binaries bundled.
BR
Marcus
C
by CSN on 18 Aug 2024
#
I'm having the same issue. Traceback when I try to install with pip on Python 3.11:
Defaulting to user installation because normal site-packages is not writeable
Collecting mathutils
Using cached mathutils-3.3.0.tar.gz (245 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mathutils
Building wheel for mathutils (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for mathutils (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_ext
building 'mathutils' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mathutils
Failed to build mathutils
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mathutils)
M
by Moult on 18 Aug 2024
#
BTW it's on the todo list to remove mathutils as a dependency and only work with numpy but we haven't gotten around to it yet. This should be a fairly well scoped task - if anybody is interested?
A
by Andrej730 on 18 Aug 2024
#
Are you sure you have 'Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"' installed?
C
by CSN on 19 Aug 2024
#
@Andrej730 said:
Are you sure you have 'Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"' installed?
From a cursory google last week I think this is a 6gb monstrosity that I probably don't have permission to install. Seems silly to install it just to be able to have a single python module installed. I just reverted to python 3.9 for this.
@Moult said:
BTW it's on the todo list to remove mathutils as a dependency and only work with numpy but we haven't gotten around to it yet. This should be a fairly well scoped task - if anybody is interested?
I thought this might be the case. Not volunteering yet though, sorry 😅
A
by Arv on 2 Sep 2024
#
@Moult said:
BTW it's on the todo list to remove mathutils as a dependency and only work with numpy but we haven't gotten around to it yet. This should be a fairly well scoped task - if anybody is interested?
@Moult Don't mind giving it a try. Any pointers on where to start?
P
by PeterPetersen on 22 Mar 2025
#
Hi Everyone, I am also facing the same problem - with ifcpatch and ifcopenshell 0.8.0 Are mathutils still a dependency in 0.8.1? Or did anyone manage to install these for python 3.11?
P
by PeterPetersen on 22 Mar 2025
#
O wow, the dependency is gone - thanks so much for the update! Fantastic!