1
votes

I'm using Google Cloud Datalab and I got an error from this code

from google.cloud import translate

Error message is here

ImportError                               Traceback (most recent call last)
<ipython-input-3-d80fb3686483> in <module>()
----> 1 from google.cloud import translate

ImportError: cannot import name 'translate'

Does it mean I need to import module to Shell??

1

1 Answers

0
votes

The google-cloud-translate library is not in the installed libraries of a Datalab instance. So, you need to install via pip first.

Try to execute the following command in a cell before importing it:

!pip install google-cloud-translate

Here you can find more information on installing python dependencies in Datalab.