Mac:安装后导入 scikit 时出错

发布于 2024-11-29 15:39:36 字数 1153 浏览 0 评论 0原文

我安装了 scikits 软件包,但无法导入它,我使用的是 Macbook,请让我知道这里缺少什么

bash-3.2$ sudo port install py26-scikits-learn
--->  Computing dependencies for py26-scikits-learn
--->  Fetching archive for py26-scikits-learn
--->  Attempting to fetch py26-scikits-learn-0.8_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/py26-scikits-learn
--->  Fetching py26-scikits-learn
--->  Verifying checksum(s) for py26-scikits-learn
--->  Extracting py26-scikits-learn
--->  Configuring py26-scikits-learn
--->  Building py26-scikits-learn
--->  Staging py26-scikits-learn into destroot
--->  Installing py26-scikits-learn @0.8_0
--->  Activating py26-scikits-learn @0.8_0
--->  Cleaning py26-scikits-learn
bash-3.2$ python -c "import scikits.learn as skl; skl.test()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named scikits.learn

已修复 如何从 OSX Leopard 卸载 python 以便可以使用 MacPorts 版本?

I installed the scikits package but can't import it, I am on Macbook, please let me know what is missing here

bash-3.2$ sudo port install py26-scikits-learn
--->  Computing dependencies for py26-scikits-learn
--->  Fetching archive for py26-scikits-learn
--->  Attempting to fetch py26-scikits-learn-0.8_0.darwin_10.x86_64.tbz2 from http://packages.macports.org/py26-scikits-learn
--->  Fetching py26-scikits-learn
--->  Verifying checksum(s) for py26-scikits-learn
--->  Extracting py26-scikits-learn
--->  Configuring py26-scikits-learn
--->  Building py26-scikits-learn
--->  Staging py26-scikits-learn into destroot
--->  Installing py26-scikits-learn @0.8_0
--->  Activating py26-scikits-learn @0.8_0
--->  Cleaning py26-scikits-learn
bash-3.2$ python -c "import scikits.learn as skl; skl.test()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named scikits.learn

FIXED
How do I uninstall python from OSX Leopard so that I can use the MacPorts version?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最近可好 2024-12-06 15:39:36

不幸的是,我不知道端口 commnad 是如何工作的(我猜它来自 MacPorts),但你应该使用 Python 来维护 Python 包(例如,自制程序鼓励这样做)。您可以尝试 pip:

sudo pip install scikits.learn

在 OS X Lion 中,Python 的默认版本是 2.7,如果您想使用 2.6,则必须:

sudo python2.6 pip install scikits.learn

(Python 为每个版本保留单独的包)

您可以使用 pypi 或使用以下命令进行搜索

pip searh foo

如果您担心系统混乱,请尝试 virtualenvwrapper

Unfortunately I don't know how port commnad works (I guess it comes from MacPorts) but you should use Python to maintain Python packages (which is encouraged eg. by homebrew). You can try pip:

sudo pip install scikits.learn

In OS X Lion default version of Python is 2.7, if you want to use 2.6 you have to:

sudo python2.6 pip install scikits.learn

(Python keeps separate packages for every version)

You can browse all packages available via pip (or easy_install) using pypi or search it with

pip searh foo

If you are afraid of cluttering you system please give a try virtualenvwrapper.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文