如何解决:导入错误:“没有名为‘graphlab’的模块?

2024-01-23

和 “源激活graphlab” 在终端中我可以启动 graphlab。

我是这样创建的:“conda create -n graphlab python=2.7 anaconda”,因为将 virtualenv 与 Anaconda 一起使用未经测试且不推荐(根据终端中的警告,我不知道是否确实如此.)。

启动 graphlab 后,终端显示:

discarding /Users/username/anaconda/bin from PATH
prepending /Users/username/anaconda/envs/graphlab/bin to PATH

但是当我想在 Spider IDE 中导入 graphlab 时,它显示以下错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/username/anaconda/lib/python3.4/site packages/spyderlib/widgets/externalshell/sitecustomize.py", line 580, in runfile
execfile(filename, namespace)
File "/Users/username/anaconda/lib/python3.4/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 48, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "/Users/username/Documents/projectname/pythonfile.py", line 3, in <module>
import graphlab as gl
ImportError: No module named 'graphlab'

我该如何解决这个问题?我对安装这些东西完全陌生,所以希望有人可以帮助我提供广泛的逐步解释。


Dato Graphlab Create 安装程序实际上并未在我的 Mac (El Capitan) 上安装 graphlab。我在终端窗口中执行了以下操作(已安装 Anaconda):

% pip install graphlab-create

随后安装了 Graphlab Create。然后您可以轻松验证:

% python
Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:29:08)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import graphlab
>>>

我注意到,Python 有时会忘记安装了 Graphlab Create。重复上面的“pip”命令将使它记住。

python /questions/tagged/python anaconda /questions/tagged/anaconda graphlab /questions/tagged/graphlab

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何解决:导入错误:“没有名为‘graphlab’的模块? 的相关文章

随机推荐