building mathutil as dependency fails for Ifcopenshell

edited August 7 in General

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

Tagged:

Comments

  • @mcnill Blender comes with mathutils, have you tried just ... stealing that? :)

  • @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...

  • 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.

  • @mcnill what about mathutils from pypi https://pypi.org/project/mathutils/

  • @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.

  • @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

  • @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

  • 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)
    
  • Are you sure you have 'Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"' installed?

  • 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?

  • @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 😅

  • @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?

Sign In or Register to comment.