0

I am a newbie of GCP. I tried to play with GCP Translation API in GCP Datalab. I setup as procedure in here(by directly input command in Datalab's Notebook)

The last lines showed that the installation was successful. But it has some red portion indicated dependencies issue. Later I exported path of my service key to GOOGLE_APPLICATION_CREDENTIALS. Later I checked auth and found no error.

gcloud auth application-default print-access-token

Later I added sample code from GCP Quick start and found error.

ContextualVersionConflict: (google-cloud-core 0.28.1 (/usr/local/envs/py2env/lib/python2.7/site-packages), Requirement.parse('google-cloud-core<2.0dev,>=1.1.0'), set(['google-cloud-translate']))

gcp_translation_api_error0 gcp_translation_api_error1

Please help me how to solve this dependency issue. Note that I selected Python2 in Datalab's Notebook.

  • You happen to mention to be using python2 within your notebook settings. Unfortunately, [Python2 version is deprecated](https://googleapis.dev/python/translation/latest/index.html#deprecated-python-versions) so please bear in mind that the last version of this library compatible with Python 2.7 is google-cloud-translate==2.0.1. Are you installing "Basic client libraries" or "Advanced client libraries"? – Sergi Muñoz Nov 17 '20 at 11:25
  • Moreover, it is recommended to use AI notebooks since they are up to date and they use official SDKs (like BigQuery Python SDK). Could you migrate to Jupyter Notebooks? Please see: https://stackoverflow.com/questions/59720589/what-is-difference-between-ai-notebook-and-cloud-datalab-in-gcp – Sergi Muñoz Nov 17 '20 at 11:26
  • Thank you very much for your comments. I will try again with python3 in Datalab. AI Notebook is also my new try. – litlefrog Nov 18 '20 at 11:21

0 Answers0