Fringo
Fringo

Reputation: 355

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

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.

Upvotes: 3

Views: 15983

Answers (5)

Vikas
Vikas

Reputation: 178

Open Anaconda command prompt. Run the following command:

pip install graphlab-create

Upvotes: 2

Sander van den Oord
Sander van den Oord

Reputation: 12808

Got the same error message, although I for sure had installed GraphLab on an environment with conda on Windows. I solved it with kernels for different environments. Do the following on command line:

activate myenv

python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

  • replace myenv in the code above with the name of the (conda-)environment in which graphlab is installed

Source (kernels for different environments): https://ipython.readthedocs.org/en/stable/install/kernel_install.html

Oh and to be sure that you actually had installed graphlab correct in your environment in the first place, you can test this by doing in command line:

Change environment:

activate nameofyourenvironment

Start Python:

python

Check in Python if GraphLab is found:

import graphlab

(if you don't get an error message, you did install graphlab correct in that particular environment)

Upvotes: 0

Dr. Java
Dr. Java

Reputation: 131

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.

Upvotes: 2

Ashay Tamhane
Ashay Tamhane

Reputation: 43

There seems to be an issue with the Spider IDE.

Try importing from the command line interpreter (Anaconda version) and it should work fine.

Upvotes: 1

Srikrishna Sridhar
Srikrishna Sridhar

Reputation: 25

The Spider IDE seems to be configured to use Python3.4 by default. That has to be changed to 2.7. This is from the error message on the issue.

Upvotes: 1

Related Questions