0

The following code imports absolutely fine at the command line:

# Modelling Algorithms
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.neighbors import KNeighborsClassifier

However in Jupyter I get the following error:

ImportError                               Traceback (most recent call last)
<ipython-input-7-f56620e65a88> in <module>()
      8 
      9 # Modelling Algorithms
---> 10 from sklearn.tree import DecisionTreeClassifier
     11 from sklearn.linear_model import LogisticRegression
     12 from sklearn.neighbors import KNeighborsClassifier

/home/username/.virtualenvs/jupyter/local/lib/python2.7/site-packages/sklearn/__init__.py in <module>()
     54     # process, as it may not be compiled yet
     55 else:
---> 56     from . import __check_build
     57     from .base import clone
     58     __check_build  # avoid flakes unused variable error

ImportError: cannot import name __check_build

The output of sys.executable is the same.

I would love to fix this.

David Boshton
  • 2,555
  • 5
  • 30
  • 51
  • Did you see [this question](https://stackoverflow.com/questions/33193171/importerror-cannot-import-name-check-build-while-importing-tfidfvectorizer-fr)? Did you restart your notebook? – BrenBarn Jun 19 '17 at 19:06
  • Nicely done. Already has scipy installed; needed to restart notebook. Thanks! – David Boshton Jun 19 '17 at 22:38

0 Answers0