sklearn installation error on python 3.11

### Describe the bug

Unable to pip install sklearn on macOS Monterey 12.6 python 3.11

It is failing when trying to prepare metadata
```
Collecting scikit-learn
  Using cached scikit-learn-1.1.2.tar.gz (7.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [299 lines of output]
```

### Steps/Code to Reproduce

```
pip install sklearn
```

### Expected Results

No error

### Actual Results

```
× Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [299 lines of output]
      Partial import of sklearn during the build process.
      setup.py:128: DeprecationWarning:
      
        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html
      
      
        from numpy.distutils.command.build_ext import build_ext  # noqa
      INFO: C compiler: clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
      
      INFO: compile options: '-c'
      INFO: clang: test_program.c
      INFO: clang objects/test_program.o -o test_program
      INFO: C compiler: clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g
      
      INFO: compile options: '-c'
      extra options: '-fopenmp'
      INFO: clang: test_program.c
      clang: error: unsupported option '-fopenmp'
      clang: error: unsupported option '-fopenmp'
      /private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-install-9kpz095r/scikit-learn_b1c60712d44842a5b1ac7ff0db3bd990/sklearn/_build_utils/openmp_helpers.py:127: UserWarning:
      
                      ***********
                      * WARNING *
                      ***********
      
      It seems that scikit-learn cannot be built with OpenMP.
      
      - Make sure you have followed the installation instructions:
      
          https://scikit-learn.org/dev/developers/advanced_installation.html
      
      - If your compiler supports OpenMP but you still see this
        message, please submit a bug report at:
      
          https://github.com/scikit-learn/scikit-learn/issues
      
      - The build will continue with OpenMP-based parallelism
        disabled. Note however that some estimators will run in
        sequential mode instead of leveraging thread-based
        parallelism.
      
                          ***
      
        warnings.warn(message)
      Compiling sklearn/__check_build/_check_build.pyx because it changed.
      Compiling sklearn/preprocessing/_csr_polynomial_expansion.pyx because it changed.
      Compiling sklearn/_loss/_loss.pyx because it changed.
      Compiling sklearn/cluster/_dbscan_inner.pyx because it changed.
      Compiling sklearn/cluster/_hierarchical_fast.pyx because it changed.
      Compiling sklearn/cluster/_k_means_common.pyx because it changed.
      Compiling sklearn/cluster/_k_means_lloyd.pyx because it changed.
      Compiling sklearn/cluster/_k_means_elkan.pyx because it changed.
      Compiling sklearn/cluster/_k_means_minibatch.pyx because it changed.
      Compiling sklearn/datasets/_svmlight_format_fast.pyx because it changed.
      Compiling sklearn/decomposition/_online_lda_fast.pyx because it changed.
      Compiling sklearn/decomposition/_cdnmf_fast.pyx because it changed.
      Compiling sklearn/ensemble/_gradient_boosting.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/histogram.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/splitting.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/_binning.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/_predictor.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/_bitset.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/common.pyx because it changed.
      Compiling sklearn/ensemble/_hist_gradient_boosting/utils.pyx because it changed.
      Compiling sklearn/feature_extraction/_hashing_fast.pyx because it changed.
      Compiling sklearn/manifold/_utils.pyx because it changed.
      Compiling sklearn/manifold/_barnes_hut_tsne.pyx because it changed.
      Compiling sklearn/metrics/cluster/_expected_mutual_info_fast.pyx because it changed.
      Compiling sklearn/metrics/_pairwise_fast.pyx because it changed.
      Compiling sklearn/metrics/_dist_metrics.pyx because it changed.
      Compiling sklearn/metrics/_pairwise_distances_reduction.pyx because it changed.
      Compiling sklearn/neighbors/_ball_tree.pyx because it changed.
      Compiling sklearn/neighbors/_kd_tree.pyx because it changed.
      Compiling sklearn/neighbors/_partition_nodes.pyx because it changed.
      Compiling sklearn/neighbors/_quad_tree.pyx because it changed.
      Compiling sklearn/tree/_tree.pyx because it changed.
      Compiling sklearn/tree/_splitter.pyx because it changed.
      Compiling sklearn/tree/_criterion.pyx because it changed.
      Compiling sklearn/tree/_utils.pyx because it changed.
      Compiling sklearn/utils/sparsefuncs_fast.pyx because it changed.
      Compiling sklearn/utils/_cython_blas.pyx because it changed.
      Compiling sklearn/utils/arrayfuncs.pyx because it changed.
      Compiling sklearn/utils/murmurhash.pyx because it changed.
      Compiling sklearn/utils/_fast_dict.pyx because it changed.
      Compiling sklearn/utils/_openmp_helpers.pyx because it changed.
      Compiling sklearn/utils/_seq_dataset.pyx because it changed.
      Compiling sklearn/utils/_weight_vector.pyx because it changed.
      Compiling sklearn/utils/_random.pyx because it changed.
      Compiling sklearn/utils/_logistic_sigmoid.pyx because it changed.
      Compiling sklearn/utils/_readonly_array_wrapper.pyx because it changed.
      Compiling sklearn/utils/_typedefs.pyx because it changed.
      Compiling sklearn/utils/_heap.pyx because it changed.
      Compiling sklearn/utils/_sorting.pyx because it changed.
      Compiling sklearn/utils/_vector_sentinel.pyx because it changed.
      Compiling sklearn/svm/_newrand.pyx because it changed.
      Compiling sklearn/svm/_libsvm.pyx because it changed.
      Compiling sklearn/svm/_liblinear.pyx because it changed.
      Compiling sklearn/svm/_libsvm_sparse.pyx because it changed.
      Compiling sklearn/linear_model/_cd_fast.pyx because it changed.
      Compiling sklearn/linear_model/_sgd_fast.pyx because it changed.
      Compiling sklearn/linear_model/_sag_fast.pyx because it changed.
      Compiling sklearn/_isotonic.pyx because it changed.
      [ 1/59] Cythonizing sklearn/__check_build/_check_build.pyx
      [ 2/59] Cythonizing sklearn/_isotonic.pyx
      [ 3/59] Cythonizing sklearn/_loss/_loss.pyx
      [ 4/59] Cythonizing sklearn/cluster/_dbscan_inner.pyx
      [ 5/59] Cythonizing sklearn/cluster/_hierarchical_fast.pyx
      [ 6/59] Cythonizing sklearn/cluster/_k_means_common.pyx
      [ 7/59] Cythonizing sklearn/cluster/_k_means_elkan.pyx
      [ 8/59] Cythonizing sklearn/cluster/_k_means_lloyd.pyx
      [ 9/59] Cythonizing sklearn/cluster/_k_means_minibatch.pyx
      [10/59] Cythonizing sklearn/datasets/_svmlight_format_fast.pyx
      [11/59] Cythonizing sklearn/decomposition/_cdnmf_fast.pyx
      [12/59] Cythonizing sklearn/decomposition/_online_lda_fast.pyx
      [13/59] Cythonizing sklearn/ensemble/_gradient_boosting.pyx
      [14/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_binning.pyx
      [15/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_bitset.pyx
      [16/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.pyx
      [17/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/_predictor.pyx
      [18/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/common.pyx
      [19/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/histogram.pyx
      [20/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/splitting.pyx
      [21/59] Cythonizing sklearn/ensemble/_hist_gradient_boosting/utils.pyx
      [22/59] Cythonizing sklearn/feature_extraction/_hashing_fast.pyx
      [23/59] Cythonizing sklearn/linear_model/_cd_fast.pyx
      [24/59] Cythonizing sklearn/linear_model/_sag_fast.pyx
      [25/59] Cythonizing sklearn/linear_model/_sgd_fast.pyx
      [26/59] Cythonizing sklearn/manifold/_barnes_hut_tsne.pyx
      [27/59] Cythonizing sklearn/manifold/_utils.pyx
      [28/59] Cythonizing sklearn/metrics/_dist_metrics.pyx
      [29/59] Cythonizing sklearn/metrics/_pairwise_distances_reduction.pyx
      [30/59] Cythonizing sklearn/metrics/_pairwise_fast.pyx
      [31/59] Cythonizing sklearn/metrics/cluster/_expected_mutual_info_fast.pyx
      [32/59] Cythonizing sklearn/neighbors/_ball_tree.pyx
      [33/59] Cythonizing sklearn/neighbors/_kd_tree.pyx
      [34/59] Cythonizing sklearn/neighbors/_partition_nodes.pyx
      [35/59] Cythonizing sklearn/neighbors/_quad_tree.pyx
      [36/59] Cythonizing sklearn/preprocessing/_csr_polynomial_expansion.pyx
      [37/59] Cythonizing sklearn/svm/_liblinear.pyx
      [38/59] Cythonizing sklearn/svm/_libsvm.pyx
      [39/59] Cythonizing sklearn/svm/_libsvm_sparse.pyx
      [40/59] Cythonizing sklearn/svm/_newrand.pyx
      [41/59] Cythonizing sklearn/tree/_criterion.pyx
      [42/59] Cythonizing sklearn/tree/_splitter.pyx
      [43/59] Cythonizing sklearn/tree/_tree.pyx
      [44/59] Cythonizing sklearn/tree/_utils.pyx
      [45/59] Cythonizing sklearn/utils/_cython_blas.pyx
      [46/59] Cythonizing sklearn/utils/_fast_dict.pyx
      [47/59] Cythonizing sklearn/utils/_heap.pyx
      [48/59] Cythonizing sklearn/utils/_logistic_sigmoid.pyx
      [49/59] Cythonizing sklearn/utils/_openmp_helpers.pyx
      [50/59] Cythonizing sklearn/utils/_random.pyx
      [51/59] Cythonizing sklearn/utils/_readonly_array_wrapper.pyx
      [52/59] Cythonizing sklearn/utils/_seq_dataset.pyx
      [53/59] Cythonizing sklearn/utils/_sorting.pyx
      [54/59] Cythonizing sklearn/utils/_typedefs.pyx
      [55/59] Cythonizing sklearn/utils/_vector_sentinel.pyx
      [56/59] Cythonizing sklearn/utils/_weight_vector.pyx
      [57/59] Cythonizing sklearn/utils/arrayfuncs.pyx
      [58/59] Cythonizing sklearn/utils/murmurhash.pyx
      [59/59] Cythonizing sklearn/utils/sparsefuncs_fast.pyx
      running dist_info
      running build_src
      INFO: build_src
      INFO: building library "libsvm-skl" sources
      INFO: building library "liblinear-skl" sources
      INFO: building extension "sklearn.__check_build._check_build" sources
      INFO: building extension "sklearn.preprocessing._csr_polynomial_expansion" sources
      INFO: building extension "sklearn._loss._loss" sources
      INFO: building extension "sklearn.cluster._dbscan_inner" sources
      INFO: building extension "sklearn.cluster._hierarchical_fast" sources
      INFO: building extension "sklearn.cluster._k_means_common" sources
      INFO: building extension "sklearn.cluster._k_means_lloyd" sources
      INFO: building extension "sklearn.cluster._k_means_elkan" sources
      INFO: building extension "sklearn.cluster._k_means_minibatch" sources
      INFO: building extension "sklearn.datasets._svmlight_format_fast" sources
      INFO: building extension "sklearn.decomposition._online_lda_fast" sources
      INFO: building extension "sklearn.decomposition._cdnmf_fast" sources
      INFO: building extension "sklearn.ensemble._gradient_boosting" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting._gradient_boosting" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting.histogram" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting.splitting" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting._binning" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting._predictor" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting._bitset" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting.common" sources
      INFO: building extension "sklearn.ensemble._hist_gradient_boosting.utils" sources
      INFO: building extension "sklearn.feature_extraction._hashing_fast" sources
      INFO: building extension "sklearn.manifold._utils" sources
      INFO: building extension "sklearn.manifold._barnes_hut_tsne" sources
      INFO: building extension "sklearn.metrics.cluster._expected_mutual_info_fast" sources
      INFO: building extension "sklearn.metrics._pairwise_fast" sources
      INFO: building extension "sklearn.metrics._dist_metrics" sources
      INFO: building extension "sklearn.metrics._pairwise_distances_reduction" sources
      INFO: building extension "sklearn.neighbors._ball_tree" sources
      INFO: building extension "sklearn.neighbors._kd_tree" sources
      INFO: building extension "sklearn.neighbors._partition_nodes" sources
      INFO: building extension "sklearn.neighbors._quad_tree" sources
      INFO: building extension "sklearn.tree._tree" sources
      INFO: building extension "sklearn.tree._splitter" sources
      INFO: building extension "sklearn.tree._criterion" sources
      INFO: building extension "sklearn.tree._utils" sources
      INFO: building extension "sklearn.utils.sparsefuncs_fast" sources
      INFO: building extension "sklearn.utils._cython_blas" sources
      INFO: building extension "sklearn.utils.arrayfuncs" sources
      INFO: building extension "sklearn.utils.murmurhash" sources
      INFO: building extension "sklearn.utils._fast_dict" sources
      INFO: building extension "sklearn.utils._openmp_helpers" sources
      INFO: building extension "sklearn.utils._seq_dataset" sources
      INFO: building extension "sklearn.utils._weight_vector" sources
      INFO: building extension "sklearn.utils._random" sources
      INFO: building extension "sklearn.utils._logistic_sigmoid" sources
      INFO: building extension "sklearn.utils._readonly_array_wrapper" sources
      INFO: building extension "sklearn.utils._typedefs" sources
      INFO: building extension "sklearn.utils._heap" sources
      INFO: building extension "sklearn.utils._sorting" sources
      INFO: building extension "sklearn.utils._vector_sentinel" sources
      INFO: building extension "sklearn.svm._newrand" sources
      INFO: building extension "sklearn.svm._libsvm" sources
      INFO: building extension "sklearn.svm._liblinear" sources
      INFO: building extension "sklearn.svm._libsvm_sparse" sources
      INFO: building extension "sklearn.linear_model._cd_fast" sources
      INFO: building extension "sklearn.linear_model._sgd_fast" sources
      INFO: building extension "sklearn.linear_model._sag_fast" sources
      INFO: building extension "sklearn._isotonic" sources
      INFO: building data_files sources
      INFO: build_src: building npy-pkg config files
      /private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      Traceback (most recent call last):
        File "/Users/pranavsastry/Documents/py/neograd/tests/venv/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/Users/pranavsastry/Documents/py/neograd/tests/venv/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/pranavsastry/Documents/py/neograd/tests/venv/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup
          self).run_setup(setup_script=setup_script)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 329, in <module>
          setup_package()
        File "setup.py", line 325, in setup_package
          setup(**metadata)
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/numpy/distutils/core.py", line 169, in setup
          return old_setup(**new_attr)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/command/dist_info.py", line 31, in run
          egg_info.run()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/numpy/distutils/command/egg_info.py", line 24, in run
          self.run_command("build_src")
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/numpy/distutils/command/build_src.py", line 144, in run
          self.build_sources()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/numpy/distutils/command/build_src.py", line 164, in build_sources
          self.build_npy_pkg_config()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/numpy/distutils/command/build_src.py", line 235, in build_npy_pkg_config
          install_cmd.finalize_options()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/numpy/distutils/command/install.py", line 21, in finalize_options
          old_install.finalize_options(self)
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/command/install.py", line 45, in finalize_options
          orig.install.finalize_options(self)
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 325, in finalize_options
          self.finalize_unix()
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 498, in finalize_unix
          self.select_scheme("posix_prefix")
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 528, in select_scheme
          return self._select_scheme(resolved)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/lf/r17346zd2gl5jn_70c1pjcr40000gn/T/pip-build-env-i2sy2_0r/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/install.py", line 537, in _select_scheme
          setattr(self, attrname, scheme[key])
                                  ~~~~~~^^^^^
      KeyError: 'headers'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
```

### Versions

```shell
v1.1.2
```

COMMENT:
Hi @pranftw, thank you for reaching out.
We encountered the same issue when building the 3.11 wheels for MacOS.
You can fix it setting the environment variable
```
SETUPTOOLS_USE_DISTUTILS=stdlib
```
see the [reference](https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html).

Please note that nightly builds are now available for python 3.11,  scikit-learn 1.2dev: they are available [here](https://anaconda.org/scipy-wheels-nightly/scikit-learn/files) ([installation instructions](https://anaconda.org/scipy-wheels-nightly/scikit-learn)). You might prefer to use them rather than compile from source.

Let us know if one of those two solutions works for you.

Labels: Bug