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
Native wheels for the macos/arm64 platform (Apple Silicon M1 hardware) #19137
Comments
In the mean time, users are recommended to use the |
Note that we could provide both macos/arm64 wheels and universal2 wheels, assuming that numpy and scipy do it. universal2 wheels for numpy and scipy might be challenging to generate because those vendor openblas which has to be partially built by gfortran which cannot natively generate fat universal2 binaries. scipy also has other fortran compiled extensions (l-bfgs, arpack....). An additional merge operation would have to be performed to generate such fat binaries. For scikit-learn, we do not need to build anything in fortran and clang can natively generate fat binaries for C/C++ compiled extensions (using cibuildwheel). |
Forcing people to use conda/miniconda. Oh my god... PS: thanks for the workaround though |
Haha, have you never used Be grateful, very grateful. |
I don't know pipenv. PS: The R package manager is pretty good, in my experience. |
Try mamba. It's a more timely conda
|
Hi All. Is there any update on this issue? |
@ogrisel Is this something that sklearn can provide as well? |
Hi. I found this fix that seems to install scikit without the need of using conda
In my case the scikit line was sufficient as I had already installed cython and scipy beforehand. Edit: A thought I just had; it might be that you can change the version number to 1.0.0, but this isn't something I've tested myself. |
This lead me on the right path, however I had to install nightly scipy instead. Afterwards I was able to install scikit-learn 1.0.0 without a problem:
|
For me it worked even without |
Finally, I fixed this problem for myself. I was able to build My problem was in So installation instruction. Pipenv
scipy = {versions = "*", markers = "platfotm_machine != 'arm64'"}
scipy-m1 = {path = ".wheels/scipy-1.8.0.dev0+1753.a063cf3-cp38-cp38-macosx_11_0_arm64.whl", markers = "platfotm_machine == 'arm64'"}
scikit-learn = {versions = "*", markers = "platfotm_machine != 'arm64'"}
scikit-learn-m1 = {path = ".wheels/scikit_learn-1.1.dev0-cp39-cp39-macosx_11_0_universal2.whl", markers = "platfotm_machine == 'arm64'"}
Installation instruction. Pip
pip install scipy --index-url=https://pypi.anaconda.org/scipy-wheels-nightly/simple
pip install .wheels/scikit_learn-1.1.dev0-cp39-cp39-macosx_11_0_universal2.whl |
I have homebrew installed python 3.9.7 and scipy version 1.7.1. I had a version of scikit-learn installed from dev 1.0 source of March 3, 2021. I installed versions 1.0
It works fine. However, in my testing of linear_model, compared to the same version running on Rosetta2, the native code on M1 runs 1.67x slower! Almost all other numerical codes run faster in native mode. |
i have an proplem to install sklearn:
it is staying in here! python 3.10.0 64-bit |
There was a problem with scipy with 3.10, maybe trying with 3.9 will help scipy/scipy#13102 (comment) |
You are literally a saviour for me. I am trying it for nearly 4 hrs now. |
Can confirm this is working on M1 (python 3.8, nightly build of scipy) If you have issues make sure you also have Cython >= 0.28.5 installed. |
|
Unfortunately, it's not working for me. I'm on Python 3.9 and M1 Pro. I'm still getting the same error. I hope there's a way for installing it without needing to use Conda. EDIT: I managed to install it using the method posted in MikhailKravets comment above. |
Do you have the latest pip? |
Yes, just checked |
I finally managed to install it. I have already tried this morning, but probably I messed something. |
thanks this works for me. and using miniforge is also quite similar. |
Do the maintainers plan to backport M1 functionality to |
How to put the downloaded package in |
You can keep the downloaded package at whatever directory you want. pip install scikit_learn-1.1.dev0-cp39-cp39-macosx_11_0_universal2.whl |
Just a note on these: they may crash your OS if you're on macOS 11. It's recommended to upgrade to macOS 12. SciPy wheels for macOS >=12 should be coming soon: https://mail.python.org/archives/list/scipy-dev@python.org/thread/LLN2O4G2XI2MPILRW2XRRVCUK336WGKF/. |
Scipy just released 1.7.3 with binary wheels |
I already installed the sklearn but it still has somthing wrong.
|
Hi, Any updates of this - for folks like me who don't want conda, just pip ? Cheers, Alex |
On Mac OS 12.2, I have been running scikit-learn 1.0.2 in native mode. Scipy 1.7.3 and python 3.9.10 were installed using homebrew. I used |
FWIW, running on an M1 I found using docker to run a jupyter notebook was the only viable work-around I could use |
I'm looking forward to use scikit-learn on my M1 Macbook. Keep up the good work! |
Any updates on this? |
Making this happen depends on the resolution of the following upstream issues:
macos/arm64
platformNote: macos/arm64 is also known as macos/aarch64.
The text was updated successfully, but these errors were encountered: