A problem when importing graphlab inside ipython (on MacOSX)

User 3198 | 2/10/2016, 10:51:04 PM

Hi, I am a newcomer in coursera machine learning course. I just tried to install the stuff to follow the course.

Even if I am not familiar in using python, I already had anaconda installed on my MacOSX. OSX 10.10.5 (Yosemite)

After having done the installation instructions,

Step 1: Ensure Python 2.7.x

Create a new conda environment with Python 2.7.x

conda create -n dato-env python=2.7 anaconda

Activate the conda environment

source activate dato-env Step 2: Ensure pip version >= 7

Ensure pip is updated to the latest version

mini conda users may need to install pip first, using 'conda install pip'

conda update pip Step 3: Install GraphLab Create

Install your licensed copy of GraphLab Create

pip install --upgrade --no-cache-dir https://get.dato.com/GraphLab-Create/1.8.1/dagoret@lal.in2p3.fr/XXXXXXXXXXXXXXXXXXXXXXXXXX/GraphLab-Create-License.tar.gz Step 4: Ensure installation of IPython and IPython Notebook

Install or update IPython and IPython Notebook

mini conda users may need to install first, using 'conda install ipython ipython-notebook'

conda update ipython ipython-notebook

I got an error when importing graphlab:

(I wonder if there is a mismatch in version of one package versus the one of graphlab.)

Would you have an idea ? I would really appreciate your help.

Many thanks.


import graphlab

RuntimeError Traceback (most recent call last) RuntimeError: module compiled against API version a but this version of numpy is 9

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

/Users/dagoret-campagnesylvie/anaconda/envs/dato-env/lib/python2.7/site-packages/graphlab/init.pyc in <module>() 58 import visualization 59 ---> 60 from graphlab.datastructures.sgraph import Vertex, Edge 61 from graphlab.datastructures.sgraph import SGraph 62 from graphlab.data_structures.sarray import SArray

/Users/dagoret-campagnesylvie/anaconda/envs/dato-env/lib/python2.7/site-packages/graphlab/data_structures/init.py in <module>() 22 23 import image ---> 24 import sframe 25 import sarray 26 import sgraph

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

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

graphlab/cython/cysarray.pxd in init graphlab.cython.cyunity()

graphlab/cython/cysframe.pxd in init graphlab.cython.cysarray()

graphlab/cython/cysframe.pyx in init graphlab.cython.cysframe()

graphlab/cython/cyflexibletype.pyx in init graphlab.cython.cyflexibletype()

/Users/dagoret-campagnesylvie/anaconda/envs/dato-env/lib/python2.7/site-packages/pandas/init.py in <module>() 5 6 try: ----> 7 from pandas import hashtable, tslib, lib 8 except ImportError as e: # pragma: no cover 9 module = str(e).lstrip('cannot import name ') # hack but overkill to use re

pandas/src/numpy.pxd in init pandas.tslib (pandas/tslib.c:102684)()

ValueError: numpy.dtype has the wrong size, try recompiling


User 12 | 2/19/2016, 12:17:21 AM

Hi Sylvie, Sorry for the delay. This looks like an issue with incompatible versions of numpy and pandas. I admit I'm not quite sure why the "import graphlab" line would trigger this, but I would start by uninstalling and re-installing numpy and pandas. There's a stack overflow thread that might help: http://stackoverflow.com/questions/24122850/pandas-valueerror-numpy-dtype-has-the-wrong-size-try-recompiling

If that doesn't fix the issue, please let us know and we'll keep trying. Thanks, Brian