scikit-learn fails to build on macOS 11 Big Sur

Describe the bug

I just tried to build scikit-learn on the new macOS and ran into a build error. It seems clang does not know how to handle the new macOS version? Is this a known issue on the side of scikit-learn or am I doing something wrong here?

`clang: error: invalid version number in '-mmacosx-version-min=11.0'`


>   ERROR: Command errored out with exit status 1:
>    command: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-build-env-2mw8n0lr/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation == '"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation != '"'"'CPython'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'scipy>=0.19.1'
>        cwd: None
>   Complete output (264 lines):
>   Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation == "CPython"' don't match your environment
>   Ignoring numpy: markers 'python_version == "3.6" and platform_system != "AIX" and platform_python_implementation != "CPython"' don't match your environment
>   Ignoring numpy: markers 'python_version == "3.7" and platform_system != "AIX"' don't match your environment
>   Ignoring numpy: markers 'python_version == "3.6" and platform_system == "AIX"' don't match your environment
>   Ignoring numpy: markers 'python_version == "3.7" and platform_system == "AIX"' don't match your environment
>   Ignoring numpy: markers 'python_version >= "3.8" and platform_system == "AIX"' don't match your environment
>   Collecting setuptools
>     Using cached setuptools-50.3.2-py3-none-any.whl (785 kB)
>   Collecting wheel
>     Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
>   Collecting Cython>=0.28.5
>     Using cached Cython-0.29.21-py2.py3-none-any.whl (974 kB)
>   Collecting numpy==1.17.3
>     Using cached numpy-1.17.3.zip (6.4 MB)
>   Processing ./Library/Caches/pip/wheels/83/ca/b4/ea72bb4d8874da78afdf7ea0fff8ef280749c4589c88a83e97/scipy-1.5.4-cp38-cp38-macosx_11_0_x86_64.whl
>   Building wheels for collected packages: numpy
>     Building wheel for numpy (setup.py): started
>     Building wheel for numpy (setup.py): finished with status 'error'
>     ERROR: Command errored out with exit status 1:
>      command: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-wheel-2n4_0a_e
>          cwd: /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/
>     Complete output (102 lines):
>     Running from numpy source directory.
>     blas_opt_info:
>     blas_mkl_info:
>     customize UnixCCompiler
>       FOUND:
>         libraries = ['mkl_rt', 'pthread']
>         library_dirs = ['/usr/local/lib']
>         define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>         include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>       FOUND:
>         libraries = ['mkl_rt', 'pthread']
>         library_dirs = ['/usr/local/lib']
>         define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>         include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>     /bin/sh: svnversion: command not found
>     non-existing path in 'numpy/distutils': 'site.cfg'
>     lapack_opt_info:
>     lapack_mkl_info:
>     customize UnixCCompiler
>       FOUND:
>         libraries = ['mkl_rt', 'pthread']
>         library_dirs = ['/usr/local/lib']
>         define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>         include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>       FOUND:
>         libraries = ['mkl_rt', 'pthread']
>         library_dirs = ['/usr/local/lib']
>         define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>         include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>     /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
>       warnings.warn(msg)
>     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
>     building py_modules sources
>     creating build
>     creating build/src.macosx-11.0-x86_64-3.8
>     creating build/src.macosx-11.0-x86_64-3.8/numpy
>     creating build/src.macosx-11.0-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 /opt/local/bin/gfortran
>     customize Gnu95FCompiler
>     customize Gnu95FCompiler using config
>     C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk
>   
>     compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c'
>     gcc: _configtest.c
>     clang: error: invalid version number in '-mmacosx-version-min=11.0'
>     failure.
>     removing: _configtest.c _configtest.o
>     Traceback (most recent call last):
>       File "<string>", line 1, in <module>
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py", line 443, in <module>
>         setup_package()
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py", line 435, in setup_package
>         setup(**metadata)
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/core.py", line 171, in setup
>         return old_setup(**new_attr)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
>         return distutils.core.setup(**attrs)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
>         dist.run_commands()
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
>         self.run_command(cmd)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
>         cmd_obj.run()
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 290, in run
>         self.run_command('build')
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
>         self.distribution.run_command(command)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
>         cmd_obj.run()
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build.py", line 47, in run
>         old_build.run(self)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build.py", line 135, in run
>         self.run_command(cmd_name)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
>         self.distribution.run_command(command)
>       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
>         cmd_obj.run()
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build_src.py", line 142, in run
>         self.build_sources()
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build_src.py", line 153, in build_sources
>         self.build_library_sources(*libname_info)
>       File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/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/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build_src.py", line 369, in generate_sources
>         source = func(extension, build_dir)
>       File "numpy/core/setup.py", line 669, in get_mathlib_info
>         raise RuntimeError("Broken toolchain: cannot link a simple C program")
>     RuntimeError: Broken toolchain: cannot link a simple C program
>     ----------------------------------------
>     ERROR: Failed building wheel for numpy
>     Running setup.py clean for numpy
>     ERROR: Command errored out with exit status 1:
>      command: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
>          cwd: /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy
>     Complete output (10 lines):
>     Running from numpy source directory.
>   
>     `setup.py clean` is not supported, use one of the following instead:
>   
>       - `git clean -xdf` (cleans all files)
>       - `git clean -Xdf` (cleans all versioned files, doesn't touch
>                           files that aren't checked into the git repo)
>   
>     Add `--force` to your command to use it anyway if you must (unsupported).
>   
>     ----------------------------------------
>     ERROR: Failed cleaning build dir for numpy
>   Failed to build numpy
>   Installing collected packages: setuptools, wheel, Cython, numpy, scipy
>       Running setup.py install for numpy: started
>       Running setup.py install for numpy: finished with status 'error'
>       ERROR: Command errored out with exit status 1:
>        command: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-record-vkl36elb/install-record.txt --single-version-externally-managed --prefix /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-build-env-2mw8n0lr/overlay --compile --install-headers /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-build-env-2mw8n0lr/overlay/include/python3.8/numpy
>            cwd: /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/
>       Complete output (111 lines):
>       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
>         FOUND:
>           libraries = ['mkl_rt', 'pthread']
>           library_dirs = ['/usr/local/lib']
>           define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>           include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>         FOUND:
>           libraries = ['mkl_rt', 'pthread']
>           library_dirs = ['/usr/local/lib']
>           define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>           include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>       /bin/sh: svnversion: command not found
>       non-existing path in 'numpy/distutils': 'site.cfg'
>       lapack_opt_info:
>       lapack_mkl_info:
>       customize UnixCCompiler
>         FOUND:
>           libraries = ['mkl_rt', 'pthread']
>           library_dirs = ['/usr/local/lib']
>           define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>           include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>         FOUND:
>           libraries = ['mkl_rt', 'pthread']
>           library_dirs = ['/usr/local/lib']
>           define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
>           include_dirs = ['/opt/local/include', '/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include']
>   
>       /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
>         warnings.warn(msg)
>       running install
>       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
>       building library "npymath" sources
>       get_default_fcompiler: matching types: '['gnu95', 'nag', 'absoft', 'ibm', 'intel', 'gnu', 'g95', 'pg']'
>       customize Gnu95FCompiler
>       Found executable /opt/local/bin/gfortran
>       customize Gnu95FCompiler
>       customize Gnu95FCompiler using config
>       C compiler: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk
>   
>       compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/opt/local/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c'
>       gcc: _configtest.c
>       clang: error: invalid version number in '-mmacosx-version-min=11.0'
>       failure.
>       removing: _configtest.c _configtest.o
>       Traceback (most recent call last):
>         File "<string>", line 1, in <module>
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py", line 443, in <module>
>           setup_package()
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py", line 435, in setup_package
>           setup(**metadata)
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/core.py", line 171, in setup
>           return old_setup(**new_attr)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
>           return distutils.core.setup(**attrs)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
>           dist.run_commands()
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
>           self.run_command(cmd)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
>           cmd_obj.run()
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/install.py", line 62, in run
>           r = self.setuptools_run()
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
>           return distutils_install.run(self)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/install.py", line 545, in run
>           self.run_command('build')
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
>           self.distribution.run_command(command)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
>           cmd_obj.run()
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build.py", line 47, in run
>           old_build.run(self)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/command/build.py", line 135, in run
>           self.run_command(cmd_name)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
>           self.distribution.run_command(command)
>         File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
>           cmd_obj.run()
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build_src.py", line 142, in run
>           self.build_sources()
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build_src.py", line 153, in build_sources
>           self.build_library_sources(*libname_info)
>         File "/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/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/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/numpy/distutils/command/build_src.py", line 369, in generate_sources
>           source = func(extension, build_dir)
>         File "numpy/core/setup.py", line 669, in get_mathlib_info
>           raise RuntimeError("Broken toolchain: cannot link a simple C program")
>       RuntimeError: Broken toolchain: cannot link a simple C program
>       ----------------------------------------
>   ERROR: Command errored out with exit status 1: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"'; __file__='"'"'/private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-install-iw5mcm96/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-record-vkl36elb/install-record.txt --single-version-externally-managed --prefix /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-build-env-2mw8n0lr/overlay --compile --install-headers /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-build-env-2mw8n0lr/overlay/include/python3.8/numpy Check the logs for full command output.
>   ----------------------------------------
> ERROR: Command errored out with exit status 1: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/bh/f3_2r0m56sn54kjcp0g3l1fw0000gn/T/pip-build-env-2mw8n0lr/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation == '"'"'CPython'"'"'' 'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"' and platform_python_implementation != '"'"'CPython'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.17.3; python_version>='"'"'3.8'"'"' and platform_system=='"'"'AIX'"'"'' 'scipy>=0.19.1' Check the logs for full command output.

Author: Fantashit

4 thoughts on “scikit-learn fails to build on macOS 11 Big Sur

  1. Indeed:

    • Python 3.8 from the system:
    /usr/bin/python3 -c "import platform; print(platform.platform())"
    macOS-11.0.1-x86_64-i386-64bit
    
    • Python 3.9 installed with homebrew:
    /usr/local/bin/python3 -c "import platform; print(platform.platform())"
    macOS-11.0.1-x86_64-i386-64bit
    
    • Python 3.8 from a conda-forge env:
    /Users/ogrisel/miniforge3/envs/py38/bin/python -c "import platform; print(platform.platform())"
    macOS-10.16-x86_64-i386-64bit
    

    So conda-forge’s Python is indeed pretending to be installed on a fake 10.16 version of macOS to bypass this problem with pip 20.2.4.

    So my guess is that we just have to wait for pip to fix this issue and use conda-forge on Big Sur in the mean time.

  2. On a related topic, I would be +1 to remove that build check. It does produce false positives (e.g. cross-compilation earlier, or some other less common setups) and I find it more helpful to have the actual compilation error rather than this opaque error.

    The one that is failing here is part of numpy’s setup.py, not scikit-learns.

    The one in scikit-learn (and that needs to be bypassed when cross-compiling) is useful to detect whether we should try to build with openmp or not, on macos.

  3. For information, pip version 20.3 has been released and will now accept the macosx_10_9 wheels on Big Sur:

    python3 -m pip install --upgrade pip
    

    then you should be able to install numpy from the wheels again. We still need to upload wheels for scikit-learn for Python 3.9 but this is another issue. It should be fixed soon.

Comments are closed.