pwsm / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

import httplib2 with google calendar #211

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
#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/h
ttplib2-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/g
oogle_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/g
oogle_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.

Original issue reported on code.google.com by lu...@hovo.id.au on 31 May 2012 at 6:11

GoogleCodeExporter commented 8 years ago
If your py file name is calendar you would never make them work

Original comment by serv...@np-mag.ru on 5 Aug 2012 at 9:50

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

Original comment by lu...@hovo.id.au on 5 Aug 2012 at 9:54

GoogleCodeExporter commented 8 years ago
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.

Original comment by joe.gregorio@gmail.com on 28 Aug 2012 at 3:13