我在iPython笔记本中收到以下错误:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-06ac68ebf148> in <module>()
5 import pandas as pd
6 import numpy as np
----> 7 from sklearn import neighbours
8
9 start_time = time.time()
ImportError: cannot import name neighbours
尝试运行以下内容时:
# Import required packages
import time
import pandas as pd
import numpy as np
from sklearn import neighbours
我在命令行上遇到了同样的问题。我的怀疑:
我最近卸载了一个独立的Python应用程序。我也多次重新安装Anadonda和scikit-learn,numpy和scipy包。
我在Windows 7上通过Anaconda 2.5.0使用Python 2.7.11。
答案 0 :(得分:1)
你想要邻居的美国拼写,即
from sklearn import neighbors