Mac:安装后导入 scikit 时出错
我安装了 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
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,我不知道端口 commnad 是如何工作的(我猜它来自 MacPorts),但你应该使用 Python 来维护 Python 包(例如,自制程序鼓励这样做)。您可以尝试 pip:
在 OS X Lion 中,Python 的默认版本是 2.7,如果您想使用 2.6,则必须:
(Python 为每个版本保留单独的包)
您可以使用 pypi 或使用以下命令进行搜索
如果您担心系统混乱,请尝试 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:
In OS X Lion default version of Python is 2.7, if you want to use 2.6 you have to:
(Python keeps separate packages for every version)
You can browse all packages available via pip (or easy_install) using pypi or search it with
If you are afraid of cluttering you system please give a try virtualenvwrapper.