Importing RandomForestRegressor produces AttributeError: module 'sklearn.metrics._dist_metrics' has no attribute 'DistanceMetric32'

### Describe the bug

Importing RandomForestRegressor produces AttributeError: module 'sklearn.metrics._dist_metrics' has no attribute 'DistanceMetric32'

### Steps/Code to Reproduce

    from sklearn.ensemble import RandomForestRegressor

### Expected Results

No error is thrown.

### Actual Results

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python3\lib\site-packages\sklearn\ensemble\__init__.py", line 5, in <module>
    from ._base import BaseEnsemble
  File "C:\Python3\lib\site-packages\sklearn\ensemble\_base.py", line 18, in <module>
    from ..tree import (
  File "C:\Python3\lib\site-packages\sklearn\tree\__init__.py", line 6, in <module>
    from ._classes import BaseDecisionTree
  File "C:\Python3\lib\site-packages\sklearn\tree\_classes.py", line 42, in <module>
    from ._criterion import Criterion
  File "sklearn\tree\_criterion.pyx", line 1, in init sklearn.tree._criterion
  File "sklearn\tree\_splitter.pyx", line 1, in init sklearn.tree._splitter
  File "sklearn\tree\_tree.pyx", line 1, in init sklearn.tree._tree
  File "C:\Python3\lib\site-packages\sklearn\neighbors\__init__.py", line 6, in <module>
    from ._ball_tree import BallTree
  File "sklearn\neighbors\_ball_tree.pyx", line 1, in init sklearn.neighbors._ball_tree
  File "C:\Python3\lib\site-packages\sklearn\metrics\__init__.py", line 41, in <module>
    from . import cluster
  File "C:\Python3\lib\site-packages\sklearn\metrics\cluster\__init__.py", line 22, in <module>
    from ._unsupervised import silhouette_samples
  File "C:\Python3\lib\site-packages\sklearn\metrics\cluster\_unsupervised.py", line 16, in <module>
    from ..pairwise import pairwise_distances_chunked
  File "C:\Python3\lib\site-packages\sklearn\metrics\pairwise.py", line 33, in <module>
    from ._pairwise_distances_reduction import PairwiseDistancesArgKmin
  File "C:\Python3\lib\site-packages\sklearn\metrics\_pairwise_distances_reduction\__init__.py", line 89, in <module>
    from ._dispatcher import (
  File "C:\Python3\lib\site-packages\sklearn\metrics\_pairwise_distances_reduction\_dispatcher.py", line 11, in <module>
    from ._base import _sqeuclidean_row_norms32, _sqeuclidean_row_norms64
  File "sklearn\metrics\_pairwise_distances_reduction\_base.pyx", line 1, in init sklearn.metrics._pairwise_distances_reduction._base
AttributeError: module 'sklearn.metrics._dist_metrics' has no attribute 'DistanceMetric32'. Did you mean: 'DistanceMetric'?

### Versions

```shell
System:
    python: 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:14:58) [MSC v.1929 64 bit (AMD64)]
executable: C:\Python3\python.exe
   machine: Windows-10-10.0.22623-SP0

Python dependencies:
      sklearn: 1.1.1
          pip: 23.0.1
   setuptools: 67.3.2
        numpy: 1.22.4
        scipy: 1.7.3
       Cython: 0.29.33
       pandas: 1.5.1
   matplotlib: 3.7.0
       joblib: 1.0.1
threadpoolctl: 2.2.0

Built with OpenMP: True
```

COMMENT:
Solved by upgrading sklearn to 1.2.1

Labels: Bug, Needs Triage