Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: 'module' object has no attribute 'SFrame'

I am taking ML course in Coursera and I have installed GraphLab Create and ipython notebook.I am new to ML and python.

I get the following error,

import graphlab
sf = graphlab.SFrame('people-example.csv')

AttributeError Traceback (most recent call last) in ()

----> 1 sf = graphlab.SFrame('people-example.csv')

AttributeError: 'module' object has no attribute 'SFrame'

How do I fix this error?I have the people-example.csv in the correct path and no spelling mistake on SFrame Any help is greatly appreciated.Thank you.

like image 675
Lotus Avatar asked Aug 14 '16 00:08

Lotus


3 Answers

In your iPython/Jupyter notebook follow these steps in this particular order.

  1. This will download and install dependencies. graphlab.get_dependencies()
  2. Restart Kernel : Kernel > Restart

  3. Now import graphlab: import graphlab

  4. sf = graphlab.SFrame('people-example.csv')

Hope this helps. Cheers!

like image 76
Maverick Avatar answered Nov 07 '22 06:11

Maverick


Make sure the library graphlab is updated and works with your current python version. Changes on built-in libraries from python 2x to 3x are likely to cause issues like this one.

like image 4
Saelyth Avatar answered Nov 07 '22 06:11

Saelyth


At first, you should run:

import graphlab
graphlab.product_key.set_product_key('your product key here')

where product_key is a key you received to your email after registering on turi.com with your Coursera credentials.

After this operation everything's going to work fine.

like image 4
Артем Кириллов Avatar answered Nov 07 '22 07:11

Артем Кириллов