Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OSX intel version too low #77

Open
matejsp opened this issue Jul 31, 2023 · 9 comments
Open

Mac OSX intel version too low #77

matejsp opened this issue Jul 31, 2023 · 9 comments

Comments

@matejsp
Copy link

matejsp commented Jul 31, 2023

Due to a bug:
numpy/numpy#17987

It is not possible to build numpy on intel on version lower than 1.20.
I propose dropping arm requirement for darwin and let 1.21 for both ... intel and m1.

            creating build
            creating build/src.macosx-13-x86_64-3.8
            creating build/src.macosx-13-x86_64-3.8/numpy
            creating build/src.macosx-13-x86_64-3.8/numpy/distutils
            building library "npymath" sources
            get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
            customize Gnu95FCompiler
            Found executable /usr/local/bin/gfortran
            Traceback (most recent call last):
              File "<string>", line 2, in <module>
              File "<pip-setuptools-caller>", line 34, in <module>
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/setup.py", line 443, in <module>
                setup_package()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/setup.py", line 435, in setup_package
                setup(**metadata)
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/core.py", line 171, in setup
                return old_setup(**new_attr)
              File "/private/tmp/workspace/workspace/ment_arch_package-builder_master/python38/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
                return distutils.core.setup(**attrs)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
                dist.run_commands()
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
                self.run_command(cmd)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
                cmd_obj.run()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/install.py", line 62, in run
                r = self.setuptools_run()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/install.py", line 36, in setuptools_run
                return distutils_install.run(self)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/install.py", line 545, in run
                self.run_command('build')
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
                self.distribution.run_command(command)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
                cmd_obj.run()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/build.py", line 47, in run
                old_build.run(self)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build.py", line 135, in run
                self.run_command(cmd_name)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
                self.distribution.run_command(command)
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
                cmd_obj.run()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/build_src.py", line 142, in run
                self.build_sources()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/build_src.py", line 153, in build_sources
                self.build_library_sources(*libname_info)
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/build_src.py", line 286, in build_library_sources
                sources = self.generate_sources(sources, (lib_name, build_info))
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/build_src.py", line 369, in generate_sources
                source = func(extension, build_dir)
              File "numpy/core/setup.py", line 667, in get_mathlib_info
                st = config_cmd.try_link('int main(void) { return 0;}')
              File "/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/config.py", line 241, in try_link
                self._check_compiler()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/command/config.py", line 82, in _check_compiler
                self.fcompiler = new_fcompiler(compiler=self.fcompiler,
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/__init__.py", line 884, in new_fcompiler
                compiler = get_default_fcompiler(plat, requiref90=requiref90,
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/__init__.py", line 855, in get_default_fcompiler
                compiler_type =  _find_existing_fcompiler(matching_compiler_types,
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/__init__.py", line 806, in _find_existing_fcompiler
                c.customize(dist)
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/__init__.py", line 530, in customize
                linker_so_flags = self.flag_vars.linker_so
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/environment.py", line 40, in __getattr__
                return self._get_var(name, conf_desc)
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/environment.py", line 56, in _get_var
                var = self._hook_handler(name, hook)
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/__init__.py", line 709, in _environment_hook
                return hook()
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/gnu.py", line 353, in get_flags_linker_so
                flags = GnuFCompiler.get_flags_linker_so(self)
              File "/private/var/folders/7_/f4wxph953b18c_63q9qxlw5r0000gp/T/pip-install-smotc_bu/numpy_75a2c57acb7d4baeb98d20a46a455e95/numpy/distutils/fcompiler/gnu.py", line 144, in get_flags_linker_so
                os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
              File "/usr/local/bin/../Cellar/[email protected]/3.8.17_1/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 680, in __setitem__
                value = self.encodevalue(value)
              File "/usr/local/bin/../Cellar/[email protected]/3.8.17_1/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/os.py", line 750, in encode
                raise TypeError("str expected, not %s" % type(value).__name__)
            TypeError: str expected, not int
            [end of output]

Current numpy for mac intel

      Collecting numpy==1.17.3
        Using cached https://nxsbts.bitstamp.net/repository/pypi-vetting/packages/numpy/1.17.3/numpy-1.17.3.zip (6.4 MB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
@rgommers
Copy link
Member

I'm going to need some more info about your actual problem @matejsp. Folks have been using this package for several years now without issues. Can you please explain what exactly is breaking for you?

macosx-13 suggests that you may be forgetting to set MACOSX_DEPLOYMENT_TARGET or some such thing.

Also, you can now migrate away from this package and build against numpy 1.25.x instead (it exports an older C API, see the note at https://numpy.org/devdocs/dev/depending_on_numpy.html#build-time-dependency).

@matejsp
Copy link
Author

matejsp commented Jul 31, 2023

I want to build pandas and required numpy. Our company policy does not allow to use binaries, but we need to compile packages ourselves (so we can fork and patch if needed).

Anyway ... running pip wheel on numpy==1.17.3 or pandas 2.0.3 (using latest oldest-supported-numpy - https://github.com/pandas-dev/pandas/blob/v2.0.3/pyproject.toml) is failing because of invalid default mac version target on some systems.

From what I understand everytime Apple releases new major OS version:

python -m sysconfig | grep MACOSX_DEPLOYMENT_TARGET

results in:
MACOSX_DEPLOYMENT_TARGET = "13.2" -> my computer
or
MACOSX_DEPLOYMENT_TARGET = 13 -> CI where we build numpy wheels

So when you build on 13 ... you get a number instead of a string and this breaks compilation.

Another issue explaining why this is broken on some OS versions:
numpy/numpy#18093

I will try setting MACOSX_DEPLOYMENT_TARGET if this will help.

@rgommers
Copy link
Member

Ah that helps, thank you.

Using export MACOSX_DEPLOYMENT_TARGET=10.13 will probably fix it; that's the value that most projects use to build wheels.

I don't really want to change this package, because it can potentially break other workflows/packages that rely on it.

@matejsp
Copy link
Author

matejsp commented Aug 24, 2023

I tried with:
export MACOSX_DEPLOYMENT_TARGET=10.13 and/or
export SYSTEM_VERSION_COMPAT=1

but not a single combination works ... this happens on python 3.8 (that we need) ... python 3.9 seems to build successfully

One or another:

    File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-14nynqkq/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 48, in get_platform
      result = calculate_macosx_platform_tag(archive_root, result)
    File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-14nynqkq/overlay/lib/python3.8/site-packages/wheel/macosx_libfile.py", line 356, in calculate_macosx_platform_tag
      assert len(base_version) == 2

when using both:

        error: $MACOSX_DEPLOYMENT_TARGET mismatch: now "12.0" but "13" during configure
        [end of output]

Based on https://endoflife.date/numpy it is hard to target anything older than 1.22 since it is no longer supported.

@rgommers
Copy link
Member

Based on https://endoflife.date/numpy it is hard to target anything older than 1.22 since it is no longer supported.

That's security support date that someone arbitrarily put at 2 years. That's wrong, but either way it's not really relevant for a build-time-only requirement.

assert len(base_version) == 2

I have no idea what is going on there, looks like a bug in wheel.

I have a macOS arm64 machine with macOS 13.3. I can run pip install numpy==1.17.3 --no-binary numpy and it installs from source just fine.

Do you have a standalone reproducer?

@matejsp
Copy link
Author

matejsp commented Aug 24, 2023

It is only relevant if you cannot build it :)
Also https://numpy.org/neps/nep-0029-deprecation_policy.html

So I have Mac OSX 13.5.1 (22G90).

python3 -m sysconfig | grep MACOSX_DEPLOYMENT_TARGET
MACOSX_DEPLOYMENT_TARGET = "13"

➜ ~ xcode-select --version
xcode-select version 2397.

➜  ~ pip install numpy==1.17.3 --no-binary numpy --index-url=https://pypi.python.org/simple --no-cache
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Looking in indexes: https://pypi.python.org/simple
Collecting numpy==1.17.3
  Downloading numpy-1.17.3.zip (6.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 11.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.23.1
    Uninstalling numpy-1.23.1:
      Successfully uninstalled numpy-1.23.1
  DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
  DEPRECATION: numpy is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451
  Running setup.py install for numpy ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for numpy did not run successfully.
  │ exit code: 1
  ╰─> [263 lines of output]
      Running from numpy source directory.
      
      Note: if you need reliable uninstall behavior, then install
      with pip instead of using `setup.py install`:
      
        - `pip install .`       (from a git repo or downloaded source
                                 release)
        - `pip install numpy`   (last NumPy release on PyPi)
      
      
      blas_opt_info:
      blas_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      blis_info:
      customize UnixCCompiler
        libraries blis not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      openblas_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries tatlas not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_3_10_blas_info:
      customize UnixCCompiler
        libraries satlas not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_blas_info:
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      accelerate_info:
      customize UnixCCompiler
        libraries accelerate not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
      Library accelerate was not found. Ignoring
      customize UnixCCompiler
        libraries veclib not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
      Library veclib was not found. Ignoring
        FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
      
        FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
      
      /bin/sh: svnversion: command not found
      non-existing path in 'numpy/distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      openblas_lapack_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      openblas_clapack_info:
      customize UnixCCompiler
      customize UnixCCompiler
        libraries openblas,lapack not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      flame_info:
      customize UnixCCompiler
        libraries flame not found in ['/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE
      
      atlas_3_10_info:
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries satlas,satlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries satlas,satlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries satlas,satlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_3_10_info'>
        NOT AVAILABLE
      
      atlas_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries ptf77blas,ptcblas,atlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_threads_info'>
        NOT AVAILABLE
      
      atlas_info:
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in /usr/local/lib
      customize UnixCCompiler
        libraries lapack_atlas not found in /usr/lib
      customize UnixCCompiler
        libraries f77blas,cblas,atlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE
      
        FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
      
      /usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      running install
      /usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src
      building py_modules sources
      creating build
      creating build/src.macosx-13-x86_64-3.9
      creating build/src.macosx-13-x86_64-3.9/numpy
      creating build/src.macosx-13-x86_64-3.9/numpy/distutils
      building library "npymath" sources
      get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
      customize Gnu95FCompiler
      Found executable /usr/local/bin/gfortran
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/setup.py", line 443, in <module>
          setup_package()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/setup.py", line 435, in setup_package
          setup(**metadata)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/core.py", line 171, in setup
          return old_setup(**new_attr)
        File "/usr/local/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/install.py", line 62, in run
          r = self.setuptools_run()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/install.py", line 36, in setuptools_run
          return distutils_install.run(self)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/install.py", line 698, in run
          self.run_command('build')
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/build.py", line 47, in run
          old_build.run(self)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/build_src.py", line 142, in run
          self.build_sources()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/build_src.py", line 153, in build_sources
          self.build_library_sources(*libname_info)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/build_src.py", line 286, in build_library_sources
          sources = self.generate_sources(sources, (lib_name, build_info))
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/build_src.py", line 369, in generate_sources
          source = func(extension, build_dir)
        File "numpy/core/setup.py", line 667, in get_mathlib_info
          st = config_cmd.try_link('int main(void) { return 0;}')
        File "/usr/local/lib/python3.9/site-packages/setuptools/_distutils/command/config.py", line 248, in try_link
          self._check_compiler()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/command/config.py", line 82, in _check_compiler
          self.fcompiler = new_fcompiler(compiler=self.fcompiler,
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/__init__.py", line 884, in new_fcompiler
          compiler = get_default_fcompiler(plat, requiref90=requiref90,
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/__init__.py", line 855, in get_default_fcompiler
          compiler_type =  _find_existing_fcompiler(matching_compiler_types,
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/__init__.py", line 806, in _find_existing_fcompiler
          c.customize(dist)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/__init__.py", line 530, in customize
          linker_so_flags = self.flag_vars.linker_so
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/environment.py", line 40, in __getattr__
          return self._get_var(name, conf_desc)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/environment.py", line 56, in _get_var
          var = self._hook_handler(name, hook)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/__init__.py", line 709, in _environment_hook
          return hook()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/gnu.py", line 353, in get_flags_linker_so
          flags = GnuFCompiler.get_flags_linker_so(self)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-b1fgnf9r/numpy_f0a668351178456692aff3696291bbcc/numpy/distutils/fcompiler/gnu.py", line 144, in get_flags_linker_so
          os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
        File "/usr/local/Cellar/[email protected]/3.9.17_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 684, in __setitem__
          value = self.encodevalue(value)
        File "/usr/local/Cellar/[email protected]/3.9.17_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 756, in encode
          raise TypeError("str expected, not %s" % type(value).__name__)
      TypeError: str expected, not int
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Rolling back uninstall of numpy
  Moving to /usr/local/bin/f2py
   from /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-uninstall-4nbxqg6f/f2py
  Moving to /usr/local/bin/f2py3
   from /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-uninstall-4nbxqg6f/f2py3
  Moving to /usr/local/bin/f2py3.9
   from /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-uninstall-4nbxqg6f/f2py3.9
  Moving to /usr/local/lib/python3.9/site-packages/numpy-1.23.1.dist-info/
   from /usr/local/lib/python3.9/site-packages/~umpy-1.23.1.dist-info
  Moving to /usr/local/lib/python3.9/site-packages/numpy/
   from /usr/local/lib/python3.9/site-packages/~umpy
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> numpy

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: python3.9 -m pip install --upgrade pip
➜  ~ 

@matejsp
Copy link
Author

matejsp commented Aug 24, 2023

I have no idea what is going on there, looks like a bug in wheel.

Yes it is bug in a wheel indeed but it is specified too old in numpy.
pypa/wheel#385 (should be 0.36.2)

It is issue when building 1.20.0:
https://github.com/numpy/numpy/blob/v1.20.0/pyproject.toml (defines as "wheel<=0.35.1")

I assume neither 1.17 nor 1.20 won't be fixed EVER by numpy team.

Reproducable for second issue:
➜ ~ python3.8 --version
Python 3.8.17

➜  ~ pip3.8 install numpy==1.20.0 --no-binary numpy --index-url=https://pypi.python.org/simple --no-cache
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Looking in indexes: https://pypi.python.org/simple
Collecting numpy==1.20.0
  Downloading numpy-1.20.0.zip (8.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 11.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for numpy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [2372 lines of output]
      numpy/random/_bounded_integers.pxd.in has not changed
      numpy/random/_philox.pyx has not changed
      numpy/random/_bounded_integers.pyx.in has not changed
      numpy/random/_sfc64.pyx has not changed
      numpy/random/_mt19937.pyx has not changed
      numpy/random/bit_generator.pyx has not changed
      Processing numpy/random/_bounded_integers.pyx
      numpy/random/mtrand.pyx has not changed
      numpy/random/_generator.pyx has not changed
      numpy/random/_pcg64.pyx has not changed
      numpy/random/_common.pyx has not changed
      Cythonizing sources
      blas_opt_info:
      blas_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      blis_info:
        libraries blis not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      openblas_info:
        libraries openblas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_3_10_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries tatlas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_3_10_blas_info:
        libraries satlas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_blas_threads_info:
      Setting PTATLAS=ATLAS
        libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_blas_info:
        libraries f77blas,cblas,atlas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      blas_info:
        libraries blas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      blas_src_info:
        NOT AVAILABLE
      
        NOT AVAILABLE
      
      non-existing path in 'numpy/distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
        libraries mkl_rt not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      openblas_lapack_info:
        libraries openblas not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      openblas_clapack_info:
        libraries openblas,lapack not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      flame_info:
        libraries flame not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries tatlas,tatlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries lapack_atlas not found in /usr/local/lib
        libraries tatlas,tatlas not found in /usr/local/lib
        libraries lapack_atlas not found in /usr/lib
        libraries tatlas,tatlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
        NOT AVAILABLE
      
      atlas_3_10_info:
        libraries lapack_atlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries satlas,satlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries lapack_atlas not found in /usr/local/lib
        libraries satlas,satlas not found in /usr/local/lib
        libraries lapack_atlas not found in /usr/lib
        libraries satlas,satlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_3_10_info'>
        NOT AVAILABLE
      
      atlas_threads_info:
      Setting PTATLAS=ATLAS
        libraries lapack_atlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries ptf77blas,ptcblas,atlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries lapack_atlas not found in /usr/local/lib
        libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
        libraries lapack_atlas not found in /usr/lib
        libraries ptf77blas,ptcblas,atlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_threads_info'>
        NOT AVAILABLE
      
      atlas_info:
        libraries lapack_atlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries f77blas,cblas,atlas not found in /usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib
        libraries lapack_atlas not found in /usr/local/lib
        libraries f77blas,cblas,atlas not found in /usr/local/lib
        libraries lapack_atlas not found in /usr/lib
        libraries f77blas,cblas,atlas not found in /usr/lib
      <class 'numpy.distutils.system_info.atlas_info'>
        NOT AVAILABLE
      
      lapack_info:
        libraries lapack not found in ['/usr/local/Cellar/[email protected]/3.8.17_1/Frameworks/Python.framework/Versions/3.8/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
      
      lapack_src_info:
        NOT AVAILABLE
      
        NOT AVAILABLE
      
      numpy_linalg_lapack_lite:
        FOUND:
          language = c
          define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]
      
      running bdist_wheel
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src

      running install_egg_info
      running egg_info
      writing numpy.egg-info/PKG-INFO
      writing dependency_links to numpy.egg-info/dependency_links.txt
      writing entry points to numpy.egg-info/entry_points.txt
      writing top-level names to numpy.egg-info/top_level.txt
      reading manifest file 'numpy.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'doc/build'
      no previously-included directories found matching 'doc/source/generated'
      no previously-included directories found matching 'benchmarks/env'
      no previously-included directories found matching 'benchmarks/results'
      no previously-included directories found matching 'benchmarks/html'
      no previously-included directories found matching 'benchmarks/numpy'
      warning: no previously-included files matching '*.pyo' found anywhere in distribution
      warning: no previously-included files matching '*.pyd' found anywhere in distribution
      warning: no previously-included files matching '*.swp' found anywhere in distribution
      warning: no previously-included files matching '*.bak' found anywhere in distribution
      warning: no previously-included files matching '*~' found anywhere in distribution
      warning: no previously-included files found matching 'LICENSES_bundled.txt'
      writing manifest file 'numpy.egg-info/SOURCES.txt'
      Copying numpy.egg-info to build/bdist.macosx-13-x86_64/wheel/numpy-1.20.0-py3.8.egg-info
      running install_scripts
      Running from numpy source directory.
      /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/numpy/distutils/system_info.py:1989: UserWarning:
          Optimized (vendor) Blas libraries are not found.
          Falls back to netlib Blas library which has worse performance.
          A better performance should be easily gained by switching
          Blas library.
        if self._calc_info(blas):
      /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/numpy/distutils/system_info.py:1989: UserWarning:
          Blas (http://www.netlib.org/blas/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [blas]) or by setting
          the BLAS environment variable.
        if self._calc_info(blas):
      /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/numpy/distutils/system_info.py:1989: UserWarning:
          Blas (http://www.netlib.org/blas/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [blas_src]) or by setting
          the BLAS_SRC environment variable.
        if self._calc_info(blas):
      /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/numpy/distutils/system_info.py:1849: UserWarning:
          Lapack (http://www.netlib.org/lapack/) libraries not found.
          Directories to search for the libraries can be specified in the
          numpy/distutils/site.cfg file (section [lapack]) or by setting
          the LAPACK environment variable.
        return getattr(self, '_calc_info_{}'.format(name))()
      /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/numpy/distutils/system_info.py:1849: UserWarning:
          Lapack (http://www.netlib.org/lapack/) sources not found.
          Directories to search for the sources can be specified in the
          numpy/distutils/site.cfg file (section [lapack_src]) or by setting
          the LAPACK_SRC environment variable.
        return getattr(self, '_calc_info_{}'.format(name))()
      /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 211, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 248, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 513, in <module>
          setup_package()
        File "setup.py", line 505, in setup_package
          setup(**metadata)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/numpy/distutils/core.py", line 169, in setup
          return old_setup(**new_attr)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 165, in setup
          return distutils.core.setup(**attrs)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 328, in run
          impl_tag, abi_tag, plat_tag = self.get_tag()
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 252, in get_tag
          plat_name = get_platform(self.bdist_dir)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 48, in get_platform
          result = calculate_macosx_platform_tag(archive_root, result)
        File "/private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-build-env-r_rjyvh_/overlay/lib/python3.8/site-packages/wheel/macosx_libfile.py", line 356, in calculate_macosx_platform_tag
          assert len(base_version) == 2
      AssertionError
      
      ########### EXT COMPILER OPTIMIZATION ###########
      Platform      :
        Architecture: x64
        Compiler    : clang
      
      CPU baseline  :
        Requested   : 'min'
        Enabled     : SSE SSE2 SSE3
        Flags       : -msse -msse2 -msse3
        Extra checks: none
      
      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
        Generated   :
                    :
        SSE41       : SSE SSE2 SSE3 SSSE3
        Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1
        Extra checks: none
        Detect      : SSE SSE2 SSE3 SSSE3 SSE41
                    : numpy/core/src/umath/_umath_tests.dispatch.c
                    :
        SSE42       : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT
        Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2
        Extra checks: none
        Detect      : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42
                    : build/src.macosx-13-x86_64-3.8/numpy/core/src/_simd/_simd.dispatch.c
                    :
        AVX2        : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C
        Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mavx2
        Extra checks: none
        Detect      : AVX F16C AVX2
                    : numpy/core/src/umath/_umath_tests.dispatch.c
                    :
        (FMA3 AVX2) : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C
        Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2
        Extra checks: none
        Detect      : AVX F16C FMA3 AVX2
                    : build/src.macosx-13-x86_64-3.8/numpy/core/src/_simd/_simd.dispatch.c
                    :
        AVX512F     : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2
        Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f
        Extra checks: AVX512F_REDUCE
        Detect      : AVX512F
                    : build/src.macosx-13-x86_64-3.8/numpy/core/src/_simd/_simd.dispatch.c
                    :
        AVX512_SKX  : SSE SSE2 SSE3 SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD
        Flags       : -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -mf16c -mfma -mavx2 -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq
        Extra checks: AVX512BW_MASK AVX512DQ_MASK
        Detect      : AVX512_SKX
                    : build/src.macosx-13-x86_64-3.8/numpy/core/src/_simd/_simd.dispatch.c
      CCompilerOpt._cache_write[796] : write cache to path -> /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/build/temp.macosx-13-x86_64-3.8/ccompiler_opt_cache_ext.py
      
      ########### CLIB COMPILER OPTIMIZATION ###########
      Platform      :
        Architecture: x64
        Compiler    : clang
      
      CPU baseline  :
        Requested   : 'min'
        Enabled     : SSE SSE2 SSE3
        Flags       : -msse -msse2 -msse3
        Extra checks: none
      
      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
        Generated   : none
      CCompilerOpt._cache_write[796] : write cache to path -> /private/var/folders/l6/nmk965l50gv_90_c4xh5x0_4ctpk94/T/pip-install-82rxhy2l/numpy_1bcdf4146081410bba640c5eb3a53689/build/temp.macosx-13-x86_64-3.8/ccompiler_opt_cache_clib.py
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

@matejsp
Copy link
Author

matejsp commented Aug 25, 2023

One idea for this project future and easier usage/upgrades would be to replace all versions (that are 1.19.x & >=py3.9)

numpy==1.23.3,>=1.25.0<2; python_version=='3.9' and platform_system=='OS400' and platform_machine!='loongarch64'

ALTERNATIVE: I don't know if you can have multiple ranges that work with setup tools (maybe >= and then exclude all version up to 1.25.*:

numpy>=1.23.3,!=1.24.*,<2; 
or
numpy>=1.19.3,!=1.20.*,!=1.21.*,!=1.22.*,!=1.23.*,!=1.24.*,<2 ; python_version=='3.9' and platform_system not in 'OS400' and platform_machine not in 'arm64|loongarch64'

For most platforms you would then just pick best numpy version with best OS compatibility and STILL retain backwards compatibility :) Could be win win :D

@rgommers
Copy link
Member

The 1.19/1.20 build issues due to dependencies are a class of problems that can't really be fixed in this package, since we must target the oldest version that works / has wheels (module the 1.25 and up changes). There's always a workaround though, by turning off build isolation and installing your desired numpy version in the environment before building the next packages that depend on numpy.

One idea for this project future and easier usage/upgrades would be to replace all versions (that are 1.19.x & >=py3.9)
...
For most platforms you would then just pick best numpy version with best OS compatibility and STILL retain backwards compatibility

This is a good idea in principle though, and while it's a major change I think we should adopt some version of this. It's related to gh-76, I'll copy your comment there since it's a generic improvement rather than being specific to the macOS Intel on Python 3.8 issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants