1

I'm having trouble applying a function to the values in an SArray object in Graphlab Create (python). The example given in the documentation even fails for me.

sa = SArray([1,2,3,4,5])
sa[sa.apply(lambda x: math.log(x) <= 1)]

returns the following:

RuntimeError: Runtime Exception: 0. Runtime Exception: 0. Traceback (most recent call last):
File "/usr/lib/python2.7/pickle.py", line 1382, in loads
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib/python2.7/pickle.py", line 1090, in load_global
klass = self.find_class(module, name)
File "/usr/lib/python2.7/pickle.py", line 1124, in find_class
__import__(module)
File "/Library/Python/2.7/site-packages/graphlab/__init__.py", line 7, in <module>
import graphlab.connect.aws as aws
AttributeError: 'module' object has no attribute 'connect'
OregEmber
  • 45
  • 6

1 Answers1

2

This can be caused by having multiple Python installations on the machine (the __import__ through pickle seems to work differently from regular Python imports and may try to load the module from a different path).

The workaround for this is to run in a virtualenv, with a pip install of graphlab-create inside the virtualenv. That should isolate the Python module loading to the correct Python installation and module path.

Zach
  • 7,730
  • 3
  • 21
  • 26