Closed enkeyz closed 3 years ago
Hello,
I am having the same issue on mybusiness v4 since march 4th. Connection was allrigth until then (using this connection for several months).
` from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request
print(creds.valid) import sys print(sys.version)
SCOPES = ['https://www.googleapis.com/auth/business.manage'] discovery_uri = "https://developers.google.com/my-business/samples/mybusiness_google_rest_v4p5.json" service = build('mybusiness', 'v4', credentials=creds, discoveryServiceUrl = discovery_uri)`
`True 3.7.5 (default, Nov 7 2019, 10:50:52) [GCC 8.3.0] UnknownApiNameOrVersion Traceback (most recent call last)
I had something very similar on Python 3.8.8 ( from this image https://hub.docker.com/_/python, tag: 3.8 ) from GCP CloudRun container:
Traceback (most recent call last): File "/usr/local/bin/bottle.py", line 868, in _handle return route.call(**args) File "/usr/local/bin/bottle.py", line 1748, in wrapper rv = callback(*a, **ka) File "/srv/main.py", line 187, in inventory gcp_client = GCPClient(project=PROJECT, region=REGION) File "/srv/main.py", line 46, in __init__ self.compute = googleapiclient.discovery.build('compute', 'v1') File "/usr/local/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper return wrapped(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/googleapiclient/discovery.py", line 273, in build content = _retrieve_discovery_doc( File "/usr/local/lib/python3.8/site-packages/googleapiclient/discovery.py", line 387, in _retrieve_discovery_doc raise UnknownApiNameOrVersion("name: %s version: %s" % (serviceName, version)) googleapiclient.errors.UnknownApiNameOrVersion: name: compute version: v1
This worked flawlessly till Thu last week. I now tested with newer image ( Python:3.9.2 ) and the error is gone. Please document any interpreter requirements, if any.
My problem is that my app needs this API to work. Development standing still until this issue resolved. Pretty sure this issue isn't completly related to this package, but Google's API platform.
Hi folks,
Please see https://github.com/googleapis/google-api-python-client/issues/1225.
Sorry, but that doesn't solve any issue I have. How can I get the discovery url? That issue you linked doesn't really help at all.
Hi @enkeyz,
From looking at the NodeJS sample linked on the documentation page, it looks like 'https://commentanalyzer.googleapis.com/$discovery/rest?version=v1alpha1' is the discovery URL.
from googleapiclient import discovery
client = discovery.build(
"commentanalyzer",
"v1alpha1",
discoveryServiceUrl="https://commentanalyzer.googleapis.com/$discovery/rest?version=v1alpha1",
static_discovery=False,
)
I'll reach out to the comment analyzer team to see if they can get their API listed in the directory.
Filed 82170350 internally to ask the API owners to update the sample or list the API in the directory.
Environment details
google-api-python-client
version: 2.0.2Steps to reproduce
Just got my API access from them, made a project, added an API key, and their sample code wouldn't work.
Code example
Stack trace