Blog

Blog

PHODAL

Mac OS scikit-learn 安装

Mac OS scikit-learn安装

用port的话

 sudo port install py26-scikit-learn

安装完执行

 python -c "import sklearn; sklearn.test()"

结果就报错

Traceback (most recent call last):
   File "<string>", line 1, in <module>
ImportError: No module named sklearn

又是一个因为版本引起的悲剧

Mac OS port python version管理

Mac OS python 列出版本

port select --list python

会有下面的结果:

 Available versions for python:
none (active)
python25-apple
python26-apple
python27
python27-apple

Mac OS python 版本选择

  sudo port select --set python python27

会提示

 Selecting 'python27' for 'python' succeeded. 'python27' is now active.

Mac OS python 显示版本

 port select --show python

结果

 The currently selected version for 'python' is 'python27'.

安装nose

 sudo pip install nose

测试 scikit-learn

python -c "import sklearn; sklearn.test()"

安装成功

    -c:1: UserWarning: sklearn.test() is no longer supported to run the
scikit-learn test suite.

After installation, you can launch the test suite from outside the
source directory (you will need to have nosetests installed)::

   $ nosetests --exe sklearn

See the web page http://scikit-learn.org/stable/install.html#testing
for more information.

This function, `sklearn.test()` does not do anything. It does not run
the tests and will be removed in release 0.16.

或许您还需要下面的文章:

关于我

Github: @phodal     微博:@phodal     知乎:@phodal    

微信公众号(Phodal)

围观我的Github Idea墙, 也许,你会遇到心仪的项目

QQ技术交流群: 321689806
comment

Feeds

RSS / Atom

最近文章

关于作者

Phodal Huang

Engineer, Consultant, Writer, Designer

ThoughtWorks 技术专家

工程师 / 咨询师 / 作家 / 设计学徒

开源深度爱好者

出版有《前端架构:从入门到微前端》、《自己动手设计物联网》、《全栈应用开发:精益实践》

联系我: h@phodal.com

微信公众号: 最新技术分享

标签