Search code examples
pythongcloudgoogle-cloud-dataproc

ImportError: unknown location


I am trying to access Jupyter files on a Google Cloud cluster from Python. I would need the google.cloud.dataproc_v1 package to do this but every time I try:

from google.cloud import dataproc_v1

or

import google.cloud.dataproc_v1

(which is what Google has on their documentation) I get this error: n from google.cloud import dataproc_v1 ImportError: cannot import name 'dataproc_v1' from 'google.cloud' (unknown location)

Why is this happening and how can I get it to import?


Solution

  • use

    python3 -m pip install google-cloud-dataproc
    

    or

    python2 -m pip install google-cloud-dataproc