【问题标题】:pygsheets oauth - client secret file does not exist (Ubuntu 14.04)pygsheets oauth - 客户端机密文件不存在(Ubuntu 14.04)
【发布时间】: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


【解决方案1】:

设置 json 文件的绝对路径就可以了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-07-27
    • 2014-09-25
    • 2014-12-03
    • 2015-02-11
    • 1970-01-01
    • 2014-12-27
    • 2015-09-06
    • 1970-01-01
    相关资源
    最近更新 更多