scikit-learn cannot be built with OpenMP support.

### Describe the bug

I would like to install TrackPal however it is indicated that "scikit-learn cannot be built with OpenMP support".


### Steps/Code to Reproduce

```shell
(base) ASUS@dyn3175-229 ~ % pip install TrackPal
Collecting TrackPal
  Obtaining dependency information for TrackPal from https://files.pythonhosted.org/packages/1c/b3/ed21fa4c8f4cfef22db71a19c34ebf741c0816a989ffc1449f64b087a920/TrackPal-1.2.0-py3-none-any.whl.metadata
  Using cached TrackPal-1.2.0-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: numpy in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (1.24.3)
Requirement already satisfied: pandas>=1.0.4 in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (2.0.3)
Requirement already satisfied: scikit-image in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (0.20.0)
Collecting scikit-learn==0.21.1 (from TrackPal)
  Using cached scikit-learn-0.21.1.tar.gz (12.2 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: tifffile in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (2023.4.12)
Requirement already satisfied: tqdm in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (4.65.0)
Requirement already satisfied: scipy in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (1.11.1)
Requirement already satisfied: statsmodels in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (0.14.0)
Requirement already satisfied: matplotlib in ./anaconda3/lib/python3.11/site-packages (from TrackPal) (3.7.2)
Collecting rdp (from TrackPal)
  Using cached rdp-0.8-py3-none-any.whl
Collecting pingouin (from TrackPal)
  Obtaining dependency information for pingouin from https://files.pythonhosted.org/packages/35/2e/8ca90e7edc93bc3d3bdf6daa6d5fc5ae4882994171c3db765365227e1d58/pingouin-0.5.4-py2.py3-none-any.whl.metadata
  Using cached pingouin-0.5.4-py2.py3-none-any.whl.metadata (1.1 kB)
Requirement already satisfied: joblib>=0.11 in ./anaconda3/lib/python3.11/site-packages (from scikit-learn==0.21.1->TrackPal) (1.2.0)
Requirement already satisfied: python-dateutil>=2.8.2 in ./anaconda3/lib/python3.11/site-packages (from pandas>=1.0.4->TrackPal) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in ./anaconda3/lib/python3.11/site-packages (from pandas>=1.0.4->TrackPal) (2023.3.post1)
Requirement already satisfied: tzdata>=2022.1 in ./anaconda3/lib/python3.11/site-packages (from pandas>=1.0.4->TrackPal) (2023.3)
Requirement already satisfied: contourpy>=1.0.1 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (1.0.5)
Requirement already satisfied: cycler>=0.10 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (4.25.0)
Requirement already satisfied: kiwisolver>=1.0.1 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (1.4.4)
Requirement already satisfied: packaging>=20.0 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (23.1)
Requirement already satisfied: pillow>=6.2.0 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (10.2.0)
Requirement already satisfied: pyparsing<3.1,>=2.3.1 in ./anaconda3/lib/python3.11/site-packages (from matplotlib->TrackPal) (3.0.9)
Requirement already satisfied: seaborn in ./anaconda3/lib/python3.11/site-packages (from pingouin->TrackPal) (0.12.2)
Collecting pandas-flavor (from pingouin->TrackPal)
  Obtaining dependency information for pandas-flavor from https://files.pythonhosted.org/packages/67/1a/bfb5574b215f530c7ac5be684f33d60b299abbebd763c203aa31755f2fb2/pandas_flavor-0.6.0-py3-none-any.whl.metadata
  Using cached pandas_flavor-0.6.0-py3-none-any.whl.metadata (6.3 kB)
Requirement already satisfied: tabulate in ./anaconda3/lib/python3.11/site-packages (from pingouin->TrackPal) (0.8.10)
Requirement already satisfied: networkx>=2.8 in ./anaconda3/lib/python3.11/site-packages (from scikit-image->TrackPal) (3.1)
Requirement already satisfied: imageio>=2.4.1 in ./anaconda3/lib/python3.11/site-packages (from scikit-image->TrackPal) (2.31.1)
Requirement already satisfied: PyWavelets>=1.1.1 in ./anaconda3/lib/python3.11/site-packages (from scikit-image->TrackPal) (1.4.1)
Requirement already satisfied: lazy_loader>=0.1 in ./anaconda3/lib/python3.11/site-packages (from scikit-image->TrackPal) (0.2)
Requirement already satisfied: patsy>=0.5.2 in ./anaconda3/lib/python3.11/site-packages (from statsmodels->TrackPal) (0.5.3)
Requirement already satisfied: six in ./anaconda3/lib/python3.11/site-packages (from patsy>=0.5.2->statsmodels->TrackPal) (1.16.0)
Requirement already satisfied: xarray in ./anaconda3/lib/python3.11/site-packages (from pandas-flavor->pingouin->TrackPal) (2023.6.0)
Using cached TrackPal-1.2.0-py3-none-any.whl (16 kB)
Using cached pingouin-0.5.4-py2.py3-none-any.whl (198 kB)
Using cached pandas_flavor-0.6.0-py3-none-any.whl (7.2 kB)
Building wheels for collected packages: scikit-learn
  Building wheel for scikit-learn (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [107 lines of output]
      /private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/setup.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
        from pkg_resources import parse_version
      Partial import of sklearn during the build process.
      /private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/setup.py:122: 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: blas_opt_info:
      INFO: blas_armpl_info:
      INFO: customize UnixCCompiler
      INFO:   libraries armpl_lp64_mp not found in ['/Users/ASUS/anaconda3/lib', '/usr/local/lib', '/usr/lib']
      INFO:   NOT AVAILABLE
      INFO:
      INFO: blas_mkl_info:
      INFO:   libraries mkl_rt not found in ['/Users/ASUS/anaconda3/lib', '/usr/local/lib', '/usr/lib']
      INFO:   NOT AVAILABLE
      INFO:
      INFO: blis_info:
      INFO:   libraries blis not found in ['/Users/ASUS/anaconda3/lib', '/usr/local/lib', '/usr/lib']
      INFO:   NOT AVAILABLE
      INFO:
      INFO: openblas_info:
      INFO: C compiler: clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/ASUS/anaconda3/include -arch arm64 -fPIC -O2 -isystem /Users/ASUS/anaconda3/include -arch arm64
      
      creating /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var
      creating /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var/folders
      creating /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var/folders/0k
      creating /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn
      creating /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T
      creating /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj
      INFO: compile options: '-c'
      INFO: clang: /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/source.c
      INFO: clang /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/source.o -L/Users/ASUS/anaconda3/lib -lopenblas -o /var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/tmpeibg2dsj/a.out
      INFO:   FOUND:
      INFO:     libraries = ['openblas', 'openblas']
      INFO:     library_dirs = ['/Users/ASUS/anaconda3/lib']
      INFO:     language = c
      INFO:     define_macros = [('HAVE_CBLAS', None)]
      INFO:
      INFO:   FOUND:
      INFO:     libraries = ['openblas', 'openblas']
      INFO:     library_dirs = ['/Users/ASUS/anaconda3/lib']
      INFO:     language = c
      INFO:     define_macros = [('HAVE_CBLAS', None)]
      INFO:
      INFO: C compiler: clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/ASUS/anaconda3/include -arch arm64 -fPIC -O2 -isystem /Users/ASUS/anaconda3/include -arch arm64
      
      INFO: compile options: '-c'
      extra options: '-fopenmp'
      INFO: clang: test_openmp.c
      clang: error: unsupported option '-fopenmp'
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/setup.py", line 290, in <module>
          setup_package()
        File "/private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/setup.py", line 286, in setup_package
          setup(**metadata)
        File "/Users/ASUS/anaconda3/lib/python3.11/site-packages/numpy/distutils/core.py", line 135, in setup
          config = configuration()
                   ^^^^^^^^^^^^^^^
        File "/private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/setup.py", line 174, in configuration
          config.add_subpackage('sklearn')
        File "/Users/ASUS/anaconda3/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1050, in add_subpackage
          config_list = self.get_subpackage(subpackage_name, subpackage_path,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/ASUS/anaconda3/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 1016, in get_subpackage
          config = self._get_configuration_from_setup_py(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/ASUS/anaconda3/lib/python3.11/site-packages/numpy/distutils/misc_util.py", line 958, in _get_configuration_from_setup_py
          config = setup_module.configuration(*args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/sklearn/setup.py", line 80, in configuration
          maybe_cythonize_extensions(top_path, config)
        File "/private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/sklearn/_build_utils/__init__.py", line 68, in maybe_cythonize_extensions
          with_openmp = check_openmp_support()
                        ^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/0k/ms745v8n35j736rszsh44zgw0000gn/T/pip-install-xdtze3v_/scikit-learn_1bf68611c12c4153a68aab99377375c8/sklearn/_build_utils/openmp_helpers.py", line 140, in check_openmp_support
          raise CompileError(err_message)
      distutils.errors.CompileError:
                          ***
      
      It seems that scikit-learn cannot be built with OpenMP support.
      
      - Make sure you have followed the installation instructions:
      
          https://scikit-learn.org/dev/developers/advanced_installation.html
      
      - If your compiler supports OpenMP but the build still fails, please
        submit a bug report at:
      
          https://github.com/scikit-learn/scikit-learn/issues
      
      - If you want to build scikit-learn without OpenMP support, you can set
        the environment variable SKLEARN_NO_OPENMP and rerun the build
        command. Note however that some estimators will run in sequential
        mode and their `n_jobs` parameter will have no effect anymore.
      
                          ***
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-learn
  Running setup.py clean for scikit-learn
Failed to build scikit-learn
ERROR: Could not build wheels for scikit-learn, which is required to install pyproject.toml-based projects

### Expected Results

I would like to install the TrackPal

### Actual Results

      distutils.errors.CompileError:
                          ***
      
      It seems that scikit-learn cannot be built with OpenMP support.
      
      - Make sure you have followed the installation instructions:
      
          https://scikit-learn.org/dev/developers/advanced_installation.html
      
      - If your compiler supports OpenMP but the build still fails, please
        submit a bug report at:
      
          https://github.com/scikit-learn/scikit-learn/issues
      
      - If you want to build scikit-learn without OpenMP support, you can set
        the environment variable SKLEARN_NO_OPENMP and rerun the build
        command. Note however that some estimators will run in sequential
        mode and their `n_jobs` parameter will have no effect anymore.
      
                          ***
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-learn
  Running setup.py clean for scikit-learn
Failed to build scikit-learn
ERROR: Could not build wheels for scikit-learn, which is required to install pyproject.toml-based projects
```

### Versions

```shell
function>
```

COMMENT:
This is not a scikit-learn issue, closing.

It looks like TrackPal wants scikit-learn=0.21.1 which is quite old (released May 2019). I managed to install TrackPal in a Python 3.7 environment, since it can find scikit-learn wheels and does not have to compile from source, see https://pypi.org/project/scikit-learn/0.21.1/#files .

Labels: Bug