Issue with Setting up API and Vision Intro - Google Cloud Tutorial

by: dpkdeepakj, 6 years ago


nano visionex.py
root@raptor06-X556UQK:~/gc/visionex# python visionex.py
Traceback (most recent call last):
  File "visionex.py", line 4, in <module>
    vision_client = vision.Client()
AttributeError: 'module' object has no attribute 'Client'
root@raptor06-X556UQK:~/gc/visionex#


code
import io
from google.cloud import vision

vision_client = vision.Client()
file_name = '250px-Guido_van_Rossum_OSCON_2006.jpg'

with io.open(file_name, 'rb') as image_file:
    content = image_file.read()
    image = vision_client.image(content=content, )

labels = image.detect_labels()
for label in labels:
    print(label.description)

i have everything enabled.. not sure what's wrong




You must be logged in to post. Please login or register an account.



I am having the same issue, did you resolve it?


-gustavocalero 6 years ago

You must be logged in to post. Please login or register an account.