Bug 287380 - math/py-numpy: ModuleNotFoundError: No module named 'distutils.msvccompiler'
Summary: math/py-numpy: ModuleNotFoundError: No module named 'distutils.msvccompiler'
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-08 08:05 UTC by O. Hartmann
Modified: 2025-06-08 08:05 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (python)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2025-06-08 08:05:03 UTC
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
[...]