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

scikit-learn fails to build on macOS 11 Big Sur #18861

Closed
hanssnah82 opened this issue Nov 18, 2020 · 17 comments
Closed

scikit-learn fails to build on macOS 11 Big Sur #18861

hanssnah82 opened this issue Nov 18, 2020 · 17 comments

Comments

@hanssnah82
Copy link

hanssnah82 commented Nov 18, 2020

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.
@glemaitre
Copy link
Member

Did you try to install from source?
If yes did you try to install from homebrew or using the compiler from conda-forge channel: https://scikit-learn.org/stable/developers/advanced_installation.html#install-bleeding-edge

@ogrisel
Copy link
Member

ogrisel commented Nov 23, 2020

By looking at the logs, this problem happens when building numpy from source. So this is not directly related to scikit-learn.

>     ERROR: Failed building wheel for numpy
>     Running setup.py clean for numpy

What I do not understand is why pip does not install the numpy wheel instead in this case. There is a wheel file for macos (numpy-1.17.3-cp38-cp38-macosx_10_9_x86_64.whl) for numpy 1.17.3 on PyPI: https://pypi.org/project/numpy/1.17.3/#files . Big Sur is macOS 11.0 and (11, 0) >= (10, 9) so this should work, unless pip considers that major version number increment do not imply forward compatibility.

Edit: apparently this is indeed the case and the problem has already been reported upstream on the pip issue tracker: pypa/pip#9138

As for the root-cause problem (clang: error: invalid version number in '-mmacosx-version-min=11.0'), I tried to upgrade my macbook air to Big Sur but it's a mid-2012 mac and it's too old and Apple will not allow me to upgrade so I cannot reproduce locally.

Apparently there is already a report when building numpy 1.19 on big sur: numpy/numpy#17784

However this is not the same error message. Maybe because numpy.distutils has changed in the mean time. This means that we might need to change our pyproject.toml to up the dependency on numpy to 1.19.4 or later for macos >= 11_0 but this is going to make the pyproject.toml expressions even more complex :(

@ogrisel
Copy link
Member

ogrisel commented Nov 23, 2020

@hanssnah82 can you please let us know if the conda-forge package of scikit-learn works on you machine?

conda create -n sklearn -c conda-forge scikit-learn pytest
conda activate sklearn
pytest --pyargs sklearn

If you have never installed conda before, please try: https://github.com/conda-forge/miniforge .

@ogrisel
Copy link
Member

ogrisel commented Nov 23, 2020

@hanssnah82 I found a machine with Big Sur and I tried to install scikit-learn with python 3.8 and pip 20.2.4 and everything is fine: pip downloads the 10_9 wheels instead of trying to build everything from source.

Please upgrade you version of pip (and check the version number with pip --version) and try again. If you still get a problem, please open a new issue with more details on how you installed Python and which version of pip you are running).

@ogrisel ogrisel closed this as completed Nov 23, 2020
@ogrisel
Copy link
Member

ogrisel commented Nov 23, 2020

Actually I tried again with pip 20.2.4 installed on the default system Python 3.8 and Python 3.9 installed from homebrew and both refuse to install the binary wheels.

In my previous experiments I used Python and pip install from conda-forge which do not have the problem. Maybe they have been patched to accept macosx_10_9 wheels while this is not the case for other distributions.

@ogrisel ogrisel reopened this Nov 23, 2020
@ogrisel
Copy link
Member

ogrisel commented Nov 23, 2020

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.

@rth
Copy link
Member

rth commented Nov 23, 2020

      raise RuntimeError("Broken toolchain: cannot link a simple C program")
  RuntimeError: Broken toolchain: cannot link a simple C program

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.

@ogrisel
Copy link
Member

ogrisel commented Nov 23, 2020

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.

@ramet
Copy link

ramet commented Nov 26, 2020

numpy can be installed without any problem using homebrew on MacOS Big Sur. The problem we have here is that, using python 3.9 installed again using homebrew, the command : pip3 install scikit-learn try to compile its own version of numpy and fail. How to force the use of the installed version of numpy ?

@glemaitre
Copy link
Member

glemaitre commented Nov 26, 2020 via email

@ramet
Copy link

ramet commented Nov 26, 2020

Thanks, using pip3 install --no-build-isolation scikit-learn, I got a working solution.

@ogrisel
Copy link
Member

ogrisel commented Nov 27, 2020

Indeed the --editable . is only useful if you want to build scikit-learn in development mode.

@ogrisel
Copy link
Member

ogrisel commented Nov 30, 2020

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.

@ogrisel
Copy link
Member

ogrisel commented Jan 6, 2021

For reference, 0.24.0 has been released for macos/x86_64 for all supported Python versions and should therefore be easy to install on Big Sur (intel) from pip assuming pip is recent enough.

So I think we can close this. Feel free to re-open another issue if you still have problems with the latest version of pip.

Note that older versions of macos have this problem with scikit-learn 0.24.0 #19063 that should be fixed in 0.24.1.

@hminooei
Copy link

On my Big Sur macOS, it doesn't work with pip version 21.1.

@frkornet
Copy link

frkornet commented May 5, 2021

I installed Big Sur 11.3.1 today. I want to contribute to scikit-learn so I tried to install a development environment. I followed the instructions on https://scikit-learn.org/dev/developers/contributing.html#contributing-code. Unfortunately, I'm unable to get the build working. I tried with conda-forge and with homebrew. Neither seems to work. Attached is a copy of the errors I'm getting.
x.log

@glemaitre
Copy link
Member

I created a new issue @frkornet because there is a small chance for people to look at a close issue. In addition, the problem might be completely different. So let's debug this problem in a new issue.

@scikit-learn scikit-learn locked as resolved and limited conversation to collaborators May 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants