Talip7/scikit-learn-issues-multilabel huggingface dataset:
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
Also, you can do a `git clean -xdf` to do a "deep clean" of all the generated files in repo. WARNING: it will delete all the files that are not under version control. Do a `git status` first to check that you have new files that you wanted to keep before attempting to run `git clean -xdf`  in a git repo.

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
@thomasjpfan command should work. But using mamba to create the env and install everything should even be faster:

```
mamba create -n sklearn-env -c conda-forge python=3.9 numpy scipy cython compilers joblib threadpoolctl pytest
conda activate sklearn-env
make clean
pip install --verbose --no-build-isolation --editable .
python -c "import sklearn; sklearn.show_versions()"
```

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
Also, feel free to use `python=3.10` nowadays. It was released 6 months ago.

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
From your [build logs](https://gist.github.com/marenwestermann/6860eff85fd264fa67f9b85f9c84a036) in https://github.com/scikit-learn/scikit-learn/issues/22581#issuecomment-1054609173 I see:

> INFO: clang: test_program.c

On my M1 Max, I get:

> arm64-apple-darwin20.0.0-clang: test_program.c

In the conda environment, can you try running `which clang`? For the build to work with conda it should point to your conda environment one (not the system one). For example, my `which clang` returns:

> /Users/thomasfan/mambaforge/envs/sk2/bin/clang

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
Note that:

```
which clang
```

cannot always be trusted. Better do:

```
hash -r  # update the PATH cache in zsh/bash
which clang
```

or use:

```
where clang
```

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
@marenwestermann in output of your build in the Python 3.8 venv you have a warning about openmp but this is just a warning and should not prevent you from building the project (without openmp parallelism). The actual error is:

```
error: invalid command 'bdist_wheel'
```

which makes me think that your system Python install is lacking some dependencies. Maybe `pip install wheel` in your venv will fix that.

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
Hum I tried again the instructions of https://github.com/scikit-learn/scikit-learn/issues/22581#issuecomment-1056674469 and now I can reproduce the crash. This is really weird, I am sure it did work (after running the pip install command previously).

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
I think it might be related to python 3.9 vs 3.10.

@marenwestermann can you please try again with:

```
conda create -n sklearn-env -y -c conda-forge numpy scipy cython compilers joblib threadpoolctl pytest
conda activate sklearn-env
make clean
pip install --verbose --no-build-isolation --editable .
python -c "import sklearn; sklearn.show_versions()"
```

EDIT: actually no, I just tried again and I still get the "killed process". But this is weird because I am doing something that makes it disappear at some point but I am not sure what.

Labels: Bug, Build / CI
Unable to successfully install scikit-learn development version with MacBookPro with chip Apple M1 Pro

### 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

```shell
function>
```

COMMENT:
Ok I think I found the cause. It might be the OS that's killing new processes that try to allocate too much memory when the system is already under memory pressure. See https://developer.apple.com/forums/thread/8664

I launched "Activity Monitor" and realized that might system was under pressure. I stopped firefox and then tried to launch the `python -c "import sklearn; sklearn.show_versions()"` from the env above and it worked!

I started firefox again but the memory usage is still fine and my python process now always work. This is very confusing. It might be a bug of macOS.

Labels: Bug, Build / CI