[Bug 287380] math/py-numpy: ModuleNotFoundError: No module named 'distutils.msvccompiler'

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 08 Jun 2025 08:05:03 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287380

            Bug ID: 287380
           Summary: math/py-numpy: ModuleNotFoundError: No module named
                    'distutils.msvccompiler'
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: python@FreeBSD.org
          Reporter: ohartmann@walstatt.org
             Flags: maintainer-feedback?(python@FreeBSD.org)
          Assignee: python@FreeBSD.org

When trying to install port "math/py-numpy" with a more recent version of port
"devel/py-setuptools" > 61 (say, 75 or 80.3. or 80.9.0), the building of the
port py-numpy bails out with the error shown below.
I'm sure the issue of deprecation of "distutils" with Python 3,12 is well
known, but I ask for a mitigation of the problem until the transition for
crucial ports towards modern setup/installer facilities has been performed. 
I can't fathom why the FreeBSD port requires a compiler/suite I associate with
Microso Soft environemts.

[...]
 =======================<phase: build          >============================
===== env: NO_DEPENDS=yes USER=root UID=0 GID=0
===>  Building for py311-numpy-1.26.4_6,1
Running from numpy source directory.
setup.py:75: DeprecationWarning: 

  `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
  of the deprecation of `distutils` itself. It will be removed for
  Python >= 3.12. For older Python versions it will remain present.
  It is recommended to use `setuptools < 60.0` for those Python versions.
  For more details, see:
    https://numpy.org/devdocs/reference/distutils_status_migration.html 


  import numpy.distutils.command.sdist
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 483, in <module>
    from numpy.distutils.core import numpy_cmdclass as cmdclass
  File
"/wrkdirs/usr/ports/math/py-numpy/work-py311/numpy-1.26.4/numpy/distutils/core.py",
line 24, in <module>
    from numpy.distutils.command import config, config_compiler, \
  File
"/wrkdirs/usr/ports/math/py-numpy/work-py311/numpy-1.26.4/numpy/distutils/command/config.py",
line 19, in <module>
    from numpy.distutils.mingw32ccompiler import generate_manifest
  File
"/wrkdirs/usr/ports/math/py-numpy/work-py311/numpy-1.26.4/numpy/distutils/mingw32ccompiler.py",
line 27, in <module>
    from distutils.msvccompiler import get_build_version as
get_build_msvc_version
ModuleNotFoundError: No module named 'distutils.msvccompiler'
*** Error code 1
[...]

-- 
You are receiving this mail because:
You are the assignee for the bug.