How to solve: ImportError: "No module named 'graphlab'?

Fringo picture Fringo · Mar 23, 2015 · Viewed 14.4k times · Source

With "source activate graphlab" in the terminal I can start up graphlab.

I've created it like this: "conda create -n graphlab python=2.7 anaconda", because using virtualenv with Anaconda is untested and not recommended (according to the warning in the terminal, I don't know whether this really is the case.).

After starting up graphlab the terminal shows:

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

But when I want to import graphlab in the Spider IDE it shows the following error:

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'

How can I solve this? I am totally new to installing these things, so hopefully someone can help me with an extensive step by step explanation.

Answer

Dr. Java picture Dr. Java · Oct 15, 2015

The Dato Graphlab Create installer did not actually install graphlab on my Mac (El Capitan). I did the following (Anaconda is installed) in a terminal window:

% pip install graphlab-create

That subsequently installed Graphlab Create. You can then easily verify:

% 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
>>>

I've noticed that occasionally, Python will forget that Graphlab Create is installed. A repeat of the above 'pip' command will cause it to remember.