unable to import graphlab

User 2051 | 6/25/2015, 3:50:51 AM

Hi, I got the following error message when import graphlab. Anybody has similar experience ? Thank!!

`

import graphlab as gl Traceback (most recent call last): File "<stdin>", line 1, in <module> File "//anaconda/lib/python2.7/site-packages/graphlab/init.py", line 23, in <module> import graphlab.connect as mt File "//anaconda/lib/python2.7/site-packages/graphlab/connect/init.py", line 15, in <module> from graphlabutil.config import DEFAULTCONFIG as defaultlocalconf File "//anaconda/lib/python2.7/site-packages/graphlabutil/init.py", line 21, in <module> clientlogfile = os.path.join(tempfile.gettempdir(), ('graphlabclient%d.log' % time.time())) File "//anaconda/lib/python2.7/tempfile.py", line 269, in gettempdir tempdir = getdefaulttempdir() File "//anaconda/lib/python2.7/tempfile.py", line 200, in getdefaulttempdir with _io.open(fd, 'wb', closefd=False) as fp: AttributeError: 'module' object has no attribute 'open'

`

Tina

Comments

User 4 | 6/26/2015, 12:17:22 AM

Hi @Tina, I have not seen this particular error before but I will try to narrow down the cause. Can you provide some more information so we can help troubleshoot? It would be helpful to know:

  • Operating system (and OS version)
  • Python version (python -V)
  • If you are using IPython, the IPython version as well (ipython -V)
  • The location of the Python and IPython processes (which python, which ipython).

User 2051 | 6/26/2015, 12:25:40 AM

Hi Zach,

Thank you very much for your reply. I am very embarrassed to confess that this problem is caused by a silly mistake I made: I implemented a io.py program trying to direct outputs to a file. This overrides the system io,py and confused graphlab. Once I renamed my program, the problem disappeared. I need to take Python 101.

Tina


User 4 | 6/26/2015, 12:30:26 AM

Hi @Tina, no worries! This is actually a very common issue and I have run into it myself, though I didn't recognize the symptom here. I am glad your problem is solved.