graphlab SFrame error

User 303 | 4/5/2015, 9:55:09 AM

I have installed graphlab in ubuntu 12.04, as mentioned in https://dato.com/products/create/quick-start-guide.html When I try helloworld.py , I get AttributeError: 'module' object has no attribute 'SFrame'

Comments

User 1190 | 4/6/2015, 5:40:06 PM

Hi @Swaroop Krothapalli,

Can you paste the content of helloworld.py, and the output of:

<pre><code> python helloworld.py </code></pre>

Thanks, -jay


User 303 | 4/8/2015, 4:39:02 PM

Here is the python code posted at "import graphlab as gl url = 'http://s3.amazonaws.com/dato-datasets/movieratings/trainingdata.csv' data = gl.SFrame.readcsv(url, columntypehints={"rating":int}) data.show() model = gl.recommender.create(data, userid="user", item_id="movie", target="rating") results = model.recommend(users=None, k=5)"

And the result is " Traceback (most recent call last): File "hello.py", line 1, in <module> import graphlab as gl File "/home/swaroop/kaggle/otto/graphlab.py", line 7, in <module> train = gl.SFrame.read_csv('train.csv') AttributeError: 'module' object has no attribute 'SFrame'"


User 1190 | 4/8/2015, 5:17:29 PM

Ah, the problem is that you have a file named "graphlab.py" so when you import graphlab as gl, it is importing your script, not the installed graphlab module. Please rename your script to something other than graphlab.py.


User 303 | 4/9/2015, 5:48:43 AM

Oh.. thanks a lot