1

I was attempting to import some modules in a Spyder IDE:

from sklearn.neighbors import KNeighborsClassifier
from mlxtend.feature_selection import ExhaustiveFeatureSelector

For both of the import statements above I get the error:

"NameError: name 'dispatcher' is not defined"

Tried install package "dispatcher"

Arturo Moncada-Torres
  • 1,236
  • 14
  • 23
  • A `ModuleNotFoundError` or `ImportError` might indicate that you need to install a package called "dispatcher". But you're not getting that. You're getting a `NameError`, which indicates a different kind of problem. This problem is internal to some code or other that references the symbol `dispatcher` without first assigning it. Examine the backtrace of the error to determine which statement or expression, on which line of which file, is throwing this exception. – jez Oct 03 '19 at 20:00

1 Answers1

0

I had the same error, but while using pandas.DataFrame.sample. I managed to track the error to numpy.random.choice, I was using version 1.15. I updated numpy to version 1.17.3 and the issue was solved. If you are using conda, you can do so by typing

conda update numpy=1.17.3

on the Anaconda prompt.

Arturo Moncada-Torres
  • 1,236
  • 14
  • 23