-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
Comments
Did you try to install from source? |
By looking at the logs, this problem happens when building numpy from source. So this is not directly related to scikit-learn.
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 ( 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 ( 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 :( |
@hanssnah82 can you please let us know if the conda-forge package of scikit-learn works on you machine?
If you have never installed conda before, please try: https://github.com/conda-forge/miniforge . |
@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 |
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 |
Indeed:
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. |
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. |
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 : |
Somehow you need to use the flag --no-build-isolation. When installing from
the source, it is what is done:
pip install --verbose --no-build-isolation --editable .
…On Thu, 26 Nov 2020 at 15:33, Pierre RAMET ***@***.***> wrote:
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 ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18861 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABY32P7FSNX3KXKRATWEPVTSRZRL5ANCNFSM4TZUYRYA>
.
--
Guillaume Lemaitre
Scikit-learn @ Inria Foundation
https://glemaitre.github.io/
|
Thanks, using |
Indeed the |
For information, pip version 20.3 has been released and will now accept the macosx_10_9 wheels on Big Sur:
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. |
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. |
On my Big Sur macOS, it doesn't work with pip version |
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. |
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. |
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?
The text was updated successfully, but these errors were encountered: