【发布时间】:2020-11-24 21:58:35
【问题描述】:
我正在按照本文档link 上的说明使用 PyDrive 在运行这部分之后
from pydrive.auth import GoogleAuth
gauth = GoogleAuth()
gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication.
似乎一切正常,我的浏览器打开,我需要使用我的 Gmail 帐户进行身份验证。但在接受最后一部分后,进程加载,我在浏览器中收到一条错误消息 Safari Screenshot 它是德语,基本上说 safari 无法连接到 localhost:8080。
在终端中我得到了这个 Traceback:
Failed to find "code" in the query parameters of the redirect.
Try command-line authentication
Traceback (most recent call last):
File "/Users/gepluse/CodeProjects/ComunioBuster/test2.py", line 4, in <module>
gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication.
File "/Users/gepluse/CodeProjects/ComunioBuster/venv/lib/python3.8/site-packages/pydrive/auth.py", line 115, in _decorated
code = decoratee(self, *args, **kwargs)
File "/Users/gepluse/CodeProjects/ComunioBuster/venv/lib/python3.8/site-packages/pydrive/auth.py", line 241, in LocalWebserverAuth
raise AuthenticationError('No code found in redirect')
pydrive.auth.AuthenticationError: No code found in redirect
我也按照这个教程link 进行了多次检查,但没有成功。
在这里的一些帖子中,防火墙是问题所在,但我的 Mac 上的防火墙没有激活。
我正在运行 macOS 10.15.7 / Python 3.8.3 / PyDrive 1.3.1
【问题讨论】:
标签: python macos python-3.8 pydrive