【发布时间】:2018-02-15 15:22:42
【问题描述】:
我已在 Windows 7 上成功安装了 pygsheets,但在我的 Ubuntu 14.04 服务器上,我不断收到此错误。 该文件名为 client_secret.json 并与我的 py 文件放在同一目录中,因此路径是相对且正确的。还尝试了 json 文件的全名。我应该将文件放在其他地方吗?我的输出错误是这样的:
gc = pygsheets.authorize(outh_file='client_secret_some_numbers_and_signs', no_cache=True)
File "/usr/local/lib/python3.4/dist-packages/pygsheets/client.py", line 549, in authorize outh_nonlocal=outh_nonlocal)
File "/usr/local/lib/python3.4/dist-packages/pygsheets/client.py", line 505, in get_outh_credentials raise IOError(2, "Client secret file does not exist.", client_secret_file)
FileNotFoundError: [Errno 2] Client secret file does not exist.: 'client_secret_some_numbers_and_signs.json'
【问题讨论】:
-
您确定文件名传递正确吗?如果是这样,请尝试从同一目录运行它并检查结果
import os; print( os.path.isfile('<file name>')) -
感谢您的快速回复。找到了解决办法。
标签: python-3.x ubuntu-14.04 pygsheets