question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

See original GitHub issue

Describe the bug

I installed the development version of scikit-learn on my computer (MacBookPro with chip Apple M1 Pro). When I ran pytest I got the following error:

(sklearn-dev) ➜  scikit-learn git:(main) pytest
=========================================================================================== test session starts ============================================================================================
platform darwin -- Python 3.9.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /Users/maren/Documents/scikit-learn, configfile: setup.cfg, testpaths: sklearn
plugins: xdist-2.5.0, forked-1.4.0, cov-3.0.0
collecting ... [1]    54294 killed     pytest

I investigated what’s going on an this is the result: https://gist.github.com/marenwestermann/9ffddb7a2f0ef6798d350f3595997ed1

I’m using a conda environment. I used the Miniforge3-MacOSX-arm64 download from here: https://github.com/conda-forge/miniforge#miniforge

This is the content of my sklearn-dev conda environment: https://gist.github.com/marenwestermann/c01fc4d3044522e329ce83d16680e1a5

Steps/Code to Reproduce

pytest
python -vvv -c "import sklearn"

Expected Results

The expected result would be that when the command pytest is run all test are either skipped or are successful.

Actual Results

Pytest result:

(sklearn-dev) ➜  scikit-learn git:(main) pytest
=========================================================================================== test session starts ============================================================================================
platform darwin -- Python 3.9.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /Users/maren/Documents/scikit-learn, configfile: setup.cfg, testpaths: sklearn
plugins: xdist-2.5.0, forked-1.4.0, cov-3.0.0
collecting ... [1]    54294 killed     pytest

Further investigation: https://gist.github.com/marenwestermann/9ffddb7a2f0ef6798d350f3595997ed1

Versions

function>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:29 (29 by maintainers)

github_iconTop GitHub Comments

3reactions
thomasjpfancommented, Feb 28, 2022

From your logs, it looks like the compiler being used is not the conda-forge one. Can you try install the compilers first?

conda create -n sklearn-env -c conda-forge python=3.9 numpy scipy cython compilers
conda activate sklearn-env
mamba install -c conda-forge joblib threadpoolctl pytest
make clean
pip install --verbose --no-build-isolation --editable .

(An alternative is to deactivate and reactivate the environment after installing compilers)

1reaction
ogriselcommented, Mar 7, 2022

@marenwestermann the upstream bug has been resolved in the conda-forge packages installed via the compilers meta-package. I tried on my machine and confirm the fix. Let me know if it does not work for you (in a new env).

Let me close this issue. Thanks for the report.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing scipy and scikit-learn on apple m1 - Stack Overflow
I am running a MacBook Pro (13", M1, 2020) with MacOS 11.6, and python 3.8 in the conda environment. Share.
Read more >
Legacy-install-failure while insta… | Apple Developer Forums
Please help me to successfully install Tensorflow in my M1 MacBook Pro. OS: macOS Big Sur v11.6; Environment python: Python 3.8.13; Environment pip:...
Read more >
Installing scikit-learn
Install the version of scikit-learn provided by your operating system or Python distribution. This is a quick option for those who have operating...
Read more >
How to Install Scikit-Learn on MacOS? - GeeksforGeeks
Method 1: Using pip to install Scikit-Learn Package ... Step 2: Check if pip3 and python3 are correctly installed. ... Step 3: Upgrade...
Read more >
Cannot install scipy mac m1
I started testing development on MacBook Air with the Apple M1 chip. ... I am unable to install scikit-learn using poetry on an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found