A problem with import graphlab

User 3531 | 3/13/2016, 8:19:46 AM

I installed graphlab-create following the guide. But when I import graphlab in dato-env and ipython for the first time, it stucked(I have to interrupt it) and went wrong when I import graphlab again.


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

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/init.py in <module>() 42 from graphlab.util import setruntimeconfig 43 ---> 44 import graphlab.connect as _mt 45 import graphlab.connect.aws as aws 46 import visualization

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

Thank you for answering!

Comments

User 15 | 3/13/2016, 11:11:21 PM

Hi,

Usually this happens because of a faulty download or a botched install. The module object will only be missing the 'connect' attribute if the installation is missing some key files. Could you try uninstalling and reinstalling to see if it was a spurious error?

Thanks,

Evan


User 3531 | 3/14/2016, 1:37:03 AM

Hi Evan,

I have tried many times, but it's always like that. As I said above, Python will stick when I run "import graphlab". After keyboard interrupt, the following error come out:

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

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/init.pyc in <module>() 64 from graphlab.toolkits import evaluation 65 import graphlab.toolkits.textanalytics as textanalytics ---> 66 import graphlab.toolkits.graphanalytics as graphanalytics 67 import graphlab.toolkits.internal as internal 68

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/toolkits/graphanalytics/init.py in <module>() 153 154 --> 155 from . import pagerank 156 from . import trianglecounting 157 from . import connected_components

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/toolkits/graphanalytics/pagerank.py in <module>() 10 import graphlab.toolkits.main as main 11 from graphlab.toolkits.graphanalytics.modelbase import GraphAnalyticsModel as ModelBase ---> 12 from graphlab.toolkits.distributed import run as distributedrun 13 from graphlab.distributedexecutionenvironment import getdistributedexecutionenvironment as getdistributedexecutionenvironment 14

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/toolkits/distributed.py in <module>() 13 import logging 14 from graphlab.connect import getmetrictracker ---> 15 from graphlab.deploy.datodistributed.pipeline.dml import dml as dml 16 from graphlab.toolkits.main import ToolkitError 17 from graphlab.toolkits.internalutils import raiseerrorifnotsframe

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/deploy/init.py in <module>() 24 # Sessions 25 from . import session ---> 26 defaultsession = session.open() 27 28 environments = session.ScopedSession(defaultsession, _Environment, """

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/deploy/session.pyc in open(location) 580 LOGGER.info('Using session dir: %s' % location) 581 --> 582 return Session(location) 583 584

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/deploy/session.pyc in init(self, location) 123 versionfile = os.path.join(self.location, 'version') 124 --> 125 with self.lock: 126 if not os.path.exists(versionfile): 127 version = SESSIONVERSION

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/util/lockfile/init.pyc in enter(self) 236 Context manager support. 237 """ --> 238 self.acquire() 239 return self 240

/mirror/anaconda2/envs/dato-env/lib/python2.7/site-packages/graphlab/util/lockfile/linklockfile.pyc in acquire(self, timeout) 47 raise AlreadyLocked("%s is already locked" % 48 self.path) ---> 49 time.sleep(timeout is not None and timeout/10 or 0.1) 50 else: 51 # Link creation succeeded. We're good to go.

KeyboardInterrupt:

Does it sleep? And when I run "import graphlab" again, the "connect" error shows up.

Thanks!


User 15 | 3/14/2016, 2:29:44 AM

Ah, I see. Check your home directory for a file named ~/.graphlab/artifacts/lock.lock If that file exists, then delete it, and it hopefully shouldn't hang anymore.


User 3531 | 3/14/2016, 2:37:27 AM

It work. Thanks!