Skip to content

"import pdsc" is broken with latest scikit-learn==1.3.2 #47

@stevenlujpl

Description

@stevenlujpl

Hi @garydoranjr, it seems import pdsc is broken with the latest scikit-learn==1.3.2. Please see the error message below:

>>> import sklearn
>>> sklearn.__version__
'1.3.2'
>>> from sklearn.neighbors import DistanceMetric
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'DistanceMetric' from 'sklearn.neighbors' (/gpfs/scratch/suds-martian-frost/visible_deployment/frost_env/lib/python3.12/site-packages/sklearn/neighbors/__init__.py)

I checked the scikit-learn release notes (please search for DistanceMetric to see relevant notes). It looks like DistanceMetric was moved from the neighbors to the metrics package in v1.3. I think we may want to consider either updating the import statement (i.e., change the import statement from from sklearn.neighbors import DistanceMetric to from sklearn.metrics import DistanceMetric) or updating the setup.py to restrict the sklearn's version to be <=1.2.2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions