googleapiclient.errors.UnknownApiNameOrVersion: name: sheets



我使用谷歌表api和服务帐户写到我的脚本中的谷歌表。我已经将我的python脚本转换为exe文件。虽然我原来的脚本工作正常,但现在我在运行exe文件

时出现以下错误

googleapiclient.errors。UnknownApiNameOrVersion: name: sheets version: v4

完整回溯:

Traceback (most recent call last):
File "pygsheetssheet.py", line 39, in __init__
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\DC\AppData\Local\Temp\_MEI165082\pygsheets\data\sheets_discovery.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "script.py", line 50, in <module>
File "Scrapersshowclix.py", line 15, in __init__
File "pygsheetsauthorization.py", line 131, in authorize
File "pygsheetsclient.py", line 61, in __init__
File "pygsheetssheet.py", line 43, in __init__
File "googleapiclient_helpers.py", line 130, in positional_wrapper
File "googleapiclientdiscovery.py", line 287, in build
File "googleapiclientdiscovery.py", line 404, in _retrieve_discovery_doc
googleapiclient.errors.UnknownApiNameOrVersion: name: sheets  version: v4

我已经尝试了在这个线程中列出的两个解决方案:https://github.com/nithinmurali/pygsheets/issues/490

另外,我已经使用pyinstaller将脚本转换为exe,它创建了一个build和dist文件夹。

我也有同样的问题,发现添加&;static_discovery= false &;构建参数工作

相关内容

最新更新