Export to GitHub

httplib2 - issue #211

import httplib2 with google calendar


Posted on May 31, 2012 by Massive Rhino

What steps will reproduce the problem?

1. easy_install --upgrade google-api-python-client

2. Run this code -> https://developers.google.com/google-apps/calendar/instantiate

3. httplib2 breaks even if you import it by it'self like below

#

What is the expected output? What do you see instead?

>>> import httplib2

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/httplib2-0.7.4-py2.7.egg/httplib2/init.py", line 42, in <module>

import calendar

File "calendar.py", line 7, in <module>

from oauth2client.file import Storage

File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/google_api_python_client-1.0beta8-py2.7.egg/oauth2client/file.py", line 28, in <module>

from client import Storage as BaseStorage

File "/Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/google_api_python_client-1.0beta8-py2.7.egg/oauth2client/client.py", line 810, in <module>

_cached_http = httplib2.Http(MemoryCache())

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

#

What version of the product are you using? On what operating system?

Running on MacOs Python 2.5, 2.6, 2.7

Please provide any additional information below.

Comment #1

Posted on Aug 5, 2012 by Massive Wombat

If your py file name is calendar you would never make them work

Comment #2

Posted on Aug 5, 2012 by Massive Rhino

It's unlikely to be a file name problem if it doesn't work using the python command line.. Thanks for the reply though.

Comment #3

Posted on Aug 28, 2012 by Massive Hippo

httplib2 uses the standard library calendar module, that's the 'import calendar' line. But it ends up importing the calendar.py you have in your local directory, which causes the stack trace you see.

Status: Invalid

Labels:
Type-Defect Priority-Medium