googleapiclient.errors.UnknownApiNameOrVersion: name: calendar version: v3
When I hit the calendar API, it's giving an unknownApiNameOrVersion error. Currently, I am using google-api-python-client version 2.41.0. And python version is 3.9.1. which is the latest. Can you suggest what the problem is? Is it version related problem?
raise UnknownApiNameOrVersion("name: %s version: %s" % (serviceName, version)) googleapiclient.errors.UnknownApiNameOrVersion: name: calendar version: v3
Hello @abhi-hash256,
I'm not able to reproduce the issue using the environment that you shared. The following code works on my machine and on a docker image that I tested using google-api-python-client==2.41.0:
>>> from googleapiclient.discovery import build
>>> build('calendar', 'v3')
<googleapiclient.discovery.Resource object at 0x7f42cec87970>
The discovery document for calendar v3 exists here and is automatically shipped with the library.
Please can you share the code that you're using ?
Hey @parthea Is it related to " static_discovery = False " after mentioning it in build to create a service object it started working. Otherwise, it was raising the error UnknownApiNameOrVersion: calendar version:v3
Previous Code
service = build("calendar", "v3", credentials=credentials)
Changed Code
service = build("calendar", "v3", credentials=credentials, static_discovery=False)
Thanks alot now its work properly for me you my time and money
Hey @parthea Is it related to " static_discovery = False " after mentioning it in build to create a service object it started working. Otherwise, it was raising the error UnknownApiNameOrVersion: calendar version:v3
Previous Code
service = build("calendar", "v3", credentials=credentials)Changed Code
service = build("calendar", "v3", credentials=credentials, static_discovery=False)
The static_discovery argument definitely helped fix the error. Thanks alot!
Thanks! @abhi-hash256 i made the chage and works perfectly!