在jupyter笔记本中导入失败,命令行成功

时间:2017-06-19 17:23:01

标签: python jupyter

以下代码在命令行中完全导入:

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

然而在Jupyter中我收到以下错误:

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

sys.executable的输出是相同的。

我很想解决这个问题。

0 个答案:

没有答案