Skip to content Skip to sidebar Skip to footer

Google Cloud Natural Language Import Error

I am having a lot of trouble with getting the Google Cloud Natural Language API running. I am trying to run a Python program in Linux on a Google VM. I am also unsure of how to run

Solution 1:

It seems that you are using wrong syntax because of the library update, you may refer now to the new one, following [1] and more specifically [2].

It seems that the official Natural Language documentation of Google Cloud is not updated yet [3], but at the end of this documentation you have links to the Python Client Library [1][2] where it explains the changes.

Your imports should be:

from google.cloudimport language_v1
from google.cloud.language_v1import enums
from google.cloud.language_v1import types

[1] https://googleapis.dev/python/language/latest/api.html

[2] https://googleapis.dev/python/language/latest/gapic/v1/api.html

[3] https://cloud.google.com/natural-language/docs/reference/libraries#client-libraries-usage-python

Post a Comment for "Google Cloud Natural Language Import Error"