0

I'm trying to extract text from a pdf(image converted to pdf) using python code provided in google docs https://cloud.google.com/vision/docs/pdf. I have created service account key and using it for authentication as mentioned in docs and I'm using google SDK in my PC. The code is getting timed out with the below error:

File "C:\*****\pdf_code.py", line 39, in async_detect_document
operation.result(timeout=180)   File "C:\Python27\lib\site-packages\google\api_core\future\polling.py", line 120, in result
raise self._exception google.api_core.exceptions.GoogleAPICallError: None Error writing final output to: gs://******/output-1-to-1.json

Any help would be appreciated.

Sagar Zala
  • 4,854
  • 9
  • 34
  • 62

2 Answers2

1

i was getting a similar error, i was using a service account to access cloud vision api and using the service account key on my local

i solved the above error by giving the same service account permissions to write on the bucket ->

  • navigate to console.cloud.google.com
  • storage->browser --> navigate to the bucket you want to store the output files in
  • select the permissions tab --> click on "add members" button
  • mention your service account in the "new members" text box -- something like "xyz-vision-api@your_project_name.iam.gserviceaccount.com"
  • select the storage-admin role
  • save

your error should be resolved

Jai Jain
  • 41
  • 1
  • 3
0

it reads: Error writing final output to: gs://******/output-1-to-1.json

... you may have to install gcloud and gsutil locally; also check bucket ACL.

while gcloud is not logged in or gsutil isn't available, this will not write to bucket.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216