Error when importing GraphLab

User 2371 | 10/6/2015, 6:35:05 AM

Hello all

I am trying to first run GraphLab

import graphlab

and I have an error

` ImportError Traceback (most recent call last) <ipython-input-1-4b66ad388e97> in <module>() ----> 1 import graphlab

/Users/***/anaconda/lib/python2.7/site-packages/graphlab/init.py in <module>() 53 54 import graphlab.connect as _mt ---> 55 import graphlab.connect.aws as aws 56 import visualization 57

/Users/***/anaconda/lib/python2.7/site-packages/graphlab/connect/aws/init.py in <module>() 16 ''' 17 ---> 18 from ec2 import getcredentials, listinstances, setcredentials

/Users/***/anaconda/lib/python2.7/site-packages/graphlab/connect/aws/ec2.py in <module>() 24 25 import graphlab.productkey ---> 26 from graphlab.connect.main import catchandlog 27 28 from graphlab.util.config import DEFAULT_CONFIG as config

/Users/***/anaconda/lib/python2.7/site-packages/graphlab/connect/main.py in <module>() 23 24 ---> 25 from graphlab.cython.cyunity import UnityGlobalProxy 26 from graphlab.cython.cyipc import PyCommClient as Client 27 from graphlab.cython.cyipc import getpublicsecretkey_pair

ImportError: dlopen(/Users/*/anaconda/lib/python2.7/site-packages/graphlab/cython/cy_unity.so, 2): no suitable image found. Did find: /Users/*/anaconda/lib/python2.7/site-packages/graphlab/cython/cy_unity.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 `

Before I ran GraphLab with no problem. The error appeared after I installed GraphLab GPU.

How can I resolve this problem? Thanks so much

Comments

User 2371 | 10/6/2015, 7:00:00 AM

Oops, I think the problem appears since I upgraded my Mac to 10.11


User 940 | 10/6/2015, 6:41:30 PM

Hi @Vinh ,

Thanks for the pointer! We will investigate and keep you posted.

Cheers! -Piotr


User 2371 | 10/10/2015, 3:24:09 PM

HI @piotr

Is there any news?


User 9 | 10/10/2015, 4:27:26 PM

Hi @vinh, GraphLab Create with GPU Acceleration is only available for Linux. If you installed on your Mac, it will not import.

To fix, uninstall this package and reinstall graphlab-create for Mac.

Uninstalling: pip uninstall graphlab-create

Installing: https://dato.com/download/install-graphlab-create.html Assuming you have already set your product key from a prior install, you can just pip install the new package. pip install graphlab-create==1.6.1

Let us know how it goes.

Tim


User 2436 | 10/18/2015, 4:03:52 AM

Hi @timmuss Same issue with me and the resolution you suggested dint work.


User 2436 | 10/18/2015, 4:44:47 AM

Yeah I fixed it.It was because of an older version of pip inside my Virtual env.Once i Updated pip and reinstalled again it started working


User 2365 | 10/19/2015, 8:00:08 AM

Hi Tim,

That worked for me too, Thanks a lot for the tip In uninstalled old pip and installed new pip

It got installaed perfect now. Thank you Rajesh


User 2495 | 10/27/2015, 1:29:52 PM

Hi all, when I import graphlab, I get the following error (even after uninstall an reinstall): ` Python 2.7.9 (default, Apr 2 2015, 15:33:21) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import graphlab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/graphlab/init.py", line 76, in <module> import graphlab.toolkits.graphanalytics as graphanalytics File "/usr/local/lib/python2.7/dist-packages/graphlab/toolkits/graphanalytics/init.py", line 155, in <module> import pagerank File "/usr/local/lib/python2.7/dist-packages/graphlab/toolkits/graphanalytics/pagerank.py", line 12, in <module> from graphlab.toolkits.distributed import run as distributedrun File "/usr/local/lib/python2.7/dist-packages/graphlab/toolkits/distributed.py", line 15, in <module> from graphlab.deploy.datodistributed.pipeline.dml import dml as dml File "/usr/local/lib/python2.7/dist-packages/graphlab/deploy/init.py", line 26, in <module> defaultsession = session.open() File "/usr/local/lib/python2.7/dist-packages/graphlab/deploy/session.py", line 582, in open return Session(location) File "/usr/local/lib/python2.7/dist-packages/graphlab/deploy/session.py", line 125, in init with self.lock: File "/usr/local/lib/python2.7/dist-packages/graphlab/util/lockfile/init.py", line 238, in enter self.acquire() File "/usr/local/lib/python2.7/dist-packages/graphlab/util/lockfile/linklockfile.py", line 20, in acquire raise LockFailed("failed to create %s" % self.unique_name) graphlab.util.lockfile.LockFailed: failed to create /home/herimanitra/.graphlab/artifacts/herimanitra-Latitude-E6530-25dac700.5485-8487416481966528707

` Any hints on how to solve it? H,


User 4 | 10/27/2015, 9:26:08 PM

Hi @Herimanitra, I think there may be a permission issue on your .graphlab directory. Can you try recursively giving yourself permission? If that command fails, it will confirm a permission issue, and you can re-run the same command with sudo to correct the issue:

chown -R herimanitra /home/herimanitra/.graphlab


User 2544 | 11/5/2015, 3:59:40 AM

I installed using Virtual environment.. Do i need to activate dato-env everytime i used it.. But still it is giving me import errors


User 2652 | 11/21/2015, 12:48:47 PM

Hi I got similar yet different import error: ` Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import graphlab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "graphlab/init.py", line 58, in <module> from graphlab.datastructures.sgraph import Vertex, Edge File "graphlab/datastructures/init.py", line 24, in <module> import sframe File "graphlab/datastructures/sframe.py", line 18, in <module> from ..connect import main as glconnect File "graphlab/connect/main.py", line 25, in <module> from graphlab.cython.cyunity import UnityGlobalProxy ImportError: dlopen(graphlab/cython/cyunity.so, 2): no suitable image found. Did find: graphlab/cython/cyunity.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 ` I am using Mac 10.10.5. I already installed python and cython and I am not using virtual environment. The steps I tried are: 1: pip install graphlab_create (which gave me the newest version) 2: Then I had the same import issue so I pip install cython (which gave me a message that I already have the newest version). 3: Uninstall graphlab package and did pip install again. S(ince I was using pip from beginning so I assume the installation should be correct.)

I appreciate any suggestions.


User 4 | 11/21/2015, 9:30:00 PM

Hi @bchen4, this is a known issue if you have an older version of pip. Older versions of pip do not have good support for the wheel packaging format. In order to support all platforms with a binary distribution we rely on the wheel format.

The error you see above happens when the egg (Linux only) is installed instead of the correct Mac or Windows wheel. Pip versions older than pip 6 seem to have broken behavior and fetch the wrong artifact for your operating system. Please try upgrading pip to at least pip 7 and see if that fixes this issue.


User 2739 | 12/6/2015, 4:33:15 AM

On Mac OS X El Capitan, even after upgrading pip, I still received many "Operation not permitted" errors. This is because it's trying to uninstall things which are now protected in Mac OS X.

I finally got around this via:

$ sudo pip install graphlab-create==1.6.1 --ignore-installed python-dateutil

Though, even after pip could install it, I still receive this error when import graphlab:

```

ImportError Traceback (most recent call last) <ipython-input-1-4b66ad388e97> in <module>() ----> 1 import graphlab

/Library/Python/2.7/site-packages/graphlab/init.py in <module>() 53 54 import graphlab.connect as _mt ---> 55 import graphlab.connect.aws as aws 56 import visualization 57

/Library/Python/2.7/site-packages/graphlab/connect/aws/init.py in <module>() 16 ''' 17 ---> 18 from ec2 import getcredentials, listinstances, setcredentials

/Library/Python/2.7/site-packages/graphlab/connect/aws/ec2.py in <module>() 24 25 import graphlab.productkey ---> 26 from graphlab.connect.main import catchandlog 27 28 from graphlab.util.config import DEFAULT_CONFIG as config

/Library/Python/2.7/site-packages/graphlab/connect/main.py in <module>() 23 24 ---> 25 from graphlab.cython.cyunity import UnityGlobalProxy 26 from graphlab.cython.cyipc import PyCommClient as Client 27 from graphlab.cython.cyipc import getpublicsecretkey_pair

ImportError: dlopen(/Library/Python/2.7/site-packages/graphlab/cython/cyunity.so, 2): Library not loaded: @rpath/libpython2.7.dylib Referenced from: /Library/Python/2.7/site-packages/graphlab/libunityshared.dylib Reason: image not found `


User 4 | 12/7/2015, 2:09:49 AM

@ejstembler Can you verify that your installation meets the minimum system requirements for Mac OS X version? This could also be a symptom of a Mac OS X version below 10.8.

What is happening here is that the "wheel" (package built especially for Mac OS X, with platform and version checks before installation) is not being installed; instead, pip is falling back to the "egg" (a generic, non-platform specific package). Unfortunately, while we would like to provide wheels for all packages (ensuring platform correctness upon installation), the following behavior prevents us from doing so and results in incorrect package installations:

  • pip will fall back to "egg" if no "wheel" matches the minimum requirements.
  • Linux does not support wheels at all, so we still have to publish an egg for Linux.

Those two pip issues seem to combine to result in the Linux egg getting installed on other platforms if the system requirements are not met, including pip version and Mac OS X version.


User 5295 | 6/16/2016, 10:51:45 AM

import sframe yield : ImportError Traceback (most recent call last) <ipython-input-1-bcce9bf7a052> in <module>() ----> 1 import sframe 2 products = sframe.SFrame('amazonbabysubset.gl/')

/Users/itaybd/anaconda/lib/python2.7/site-packages/sframe/init.py in <module>() 37 from . import visualization 38 ---> 39 from .datastructures.sgraph import Vertex, Edge 40 from .datastructures.sgraph import SGraph 41 from .data_structures.sframe import SFrame

/Users/itaybd/anaconda/lib/python2.7/site-packages/sframe/data_structures/init.py in <module>() 23 24 from . import image ---> 25 from . import sframe 26 from . import sarray 27 from . import sgraph

/Users/itaybd/anaconda/lib/python2.7/site-packages/sframe/datastructures/sframe.py in <module>() 17 ''' 18 from .. import connect as mt ---> 19 from ..connect import main as glconnect 20 from ..cython.cyflexibletype import infertypeoflist 21 from ..cython.context import debugtrace as cython_context

/Users/itaybd/anaconda/lib/python2.7/site-packages/sframe/connect/main.py in <module>() 11 ''' 12 ---> 13 from ..cython.cyunity import UnityGlobalProxy 14 from ..cython import cyipc 15 from ..cython.cy_server import EmbeddedServer

ImportError: dlopen(/Users/itaybd/anaconda/lib/python2.7/site-packages/sframe/cython/cyunity.so, 2): no suitable image found. Did find: /Users/itaybd/anaconda/lib/python2.7/site-packages/sframe/cython/cyunity.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00


User 940 | 6/20/2016, 6:13:51 PM

Hi @bdi2357 ,

Could you verify Mac OSX and pip versions? See @"Zach"'s post above. This seems to be the same issue.

Cheers! -Piotr


User 4 | 6/20/2016, 6:17:08 PM

@bdi2357 @piotr -- in case it was not clear from above, if the version of Mac OS X is supported (10.8+), then upgrading pip to the latest available version should fix this issue.