0

I'm working through Introduction to Machine Learning with Python and am getting a value error when using the following code:

from sklearn.neighbors import KNeighborsClassifier
ValueError                               Traceback (most recent call last)
Cell In[45], line 1
----> 1 from sklearn.neighbors import KNeighborsClassifier

File ~/anaconda3/lib/python3.11/site-packages/sklearn/neighbors/__init__.py:6
      1 """
      2 The :mod:`sklearn.neighbors` module implements the k-nearest neighbors
      3 algorithm.
      4 """
----> 6 from ._ball_tree import BallTree
      7 from ._kd_tree import KDTree
      8 from ._distance_metric import DistanceMetric

File sklearn/neighbors/_ball_tree.pyx:1, in init sklearn.neighbors._ball_tree()

ValueError: sklearn.metrics._dist_metrics.DistanceMetric size changed, may indicate binary incompatibility. Expected 472 from C header, got 16 from PyObject

Any ideas?

I've tried doing a google search for this piece of code but found nothing to troubleshoot and the github files do not have notes on errors.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
jayjay29
  • 1
  • 1

0 Answers0