在我的OSX笔记本电脑上,我已按照this页面上的说明将此命令pip install -U numpy scipy scikit-learn
复制并粘贴到终端,安装了Sci Kit Learn。
这是我在终端上再次运行命令时得到的结果:
Requirement already up-to-date: numpy in /usr/local/lib/python2.7/site- packages
Requirement already up-to-date: scipy in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: scikit-learn in /usr/local/lib/python2.7/site-packages
Cleaning up...
这是我在Python 3.3.4上运行from sklearn import datasets
时收到的错误消息。 IDLE :(我正在尝试this示例)
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
from sklearn import dataset
ImportError: No module named 'sklearn'
这里有什么问题?
答案 0 :(得分:1)
您可以在日志中看到为python 2.7安装的软件包
Requirement already up-to-date: numpy in /usr/local/lib/python2.7/site-packages
你正在运行python 3.3.4 因此要么使用python 2.7.x运行它,要么安装python3.x的包。怎么样?查看here