我遵循本指南https://developers.google.com/sheets/api/quickstart/python
运行他们提供的示例代码(我唯一改变的是api秘密的位置,因为我们已经有一个设置和APPLICATION_NAME)我收到此错误
AttributeError: 'module' object has no attribute 'DEFAULT_MAX_REDIRECTS'
在错误之前记录
File "generate_report.py", line 2, in <module>
import httplib2
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/httplib2/__init__.py", line 42, in <module>
import calendar
File "/Users/HarshaGoli/Git/PantherBot/scripts/calendar.py", line 1, in <module>
from oauth2client.service_account import ServiceAccountCredentials
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/oauth2client/service_account.py", line 25, in <module>
from oauth2client import client
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/oauth2client/client.py", line 39, in <module>
from oauth2client import transport
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/oauth2client/transport.py", line 255, in <module>
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
答案 0 :(得分:4)
我得到了同样的错误,并对问题进行了调查
就我而言,它是由名为&#39;&#39; calendar.py&#34;的文件引起的。在同一目录中。
它说你应该避免使用可用于标准python库的通用名称。
答案 1 :(得分:1)
可能是版本问题。可能python3
httplib2
版factorial(0,1).
factorial(N,F) :-
N>0,
N1 is N-1,
factorial(N1,F1),
F is N * F1.
会造成麻烦,请尝试按照post