Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

ModuleNotFoundError: No module named 'google.cloud.dataproc_v1.gapic' #421

Closed
sneha2701 opened this issue May 18, 2022 · 3 comments
Closed
Labels
api: dataproc Issues related to the googleapis/python-dataproc API. type: question Request for information or clarification. Not an issue.

Comments

@sneha2701
Copy link

code:

import base64
from google.cloud import dataproc_v1
from google.cloud.dataproc_v1.gapic.transports import cluster_controller_grpc_transport

def hello_pubsub(event, context):
pubsub_message = base64.b64decode(event['data']).decode('utf-8')
print(pubsub_message)
print("inside function")
#region = "us-central1"
transport = cluster_controller_grpc_transport.ClusterControllerGrpcTransport(
address='us-central1-dataproc.googleapis.com:443')
client = dataproc_v1.ClusterControllerClient(transport)
#region = "us-central1"
print("Client value is", client)

Initialize request argument(s)

request = dataproc_v1.DeleteWorkflowTemplateRequest(
name="projects/xyz/regions/us-central1/workflowTemplates/template-123",
)

Make the request

if client.delete_workflow_template(request=request) == 1:
print("Client")
else:
print("Not deleted")

requirement.txt

google-cloud
google-cloud-dataproc
google-cloud-ndb
grpcio

@product-auto-label product-auto-label bot added the api: datastore Issues related to the Cloud Datastore API. label May 18, 2022
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label May 19, 2022
@parthea parthea added type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels May 19, 2022
@parthea parthea transferred this issue from googleapis/python-datastore May 19, 2022
@product-auto-label product-auto-label bot added api: dataproc Issues related to the googleapis/python-dataproc API. and removed api: datastore Issues related to the Cloud Datastore API. labels May 19, 2022
@jjkoh95
Copy link

jjkoh95 commented Jan 7, 2023

I faced this issue awhile ago here, and I believe the gapic module might be deprecated and removed

This is the solution that I found:

    client = dataproc_v1.ClusterControllerClient(
        client_options={"api_endpoint": "us-central1-dataproc.googleapis.com:443"},
    )

Here's for version:

google-cloud-dataproc==5.0.3

@namdyny
Copy link

namdyny commented Feb 17, 2023

I faced similar issue as well. Since #71, ClusterControllerGrpcTransport is being moved to google/cloud/dataproc_v1/services/cluster_controller/transports/grpc.py, which is imported by google/cloud/dataproc_v1/services/cluster_controller/transports/__init__.py. Following this path, you should be able to import ClusterControllerGrpcTransport.
Note: the namespace for ClusterControllerGrpcTransport is not mentioned in google/cloud/dataproc_v1/__init__.py

@parthea
Copy link
Contributor

parthea commented Apr 17, 2023

Closing as obsolete as the gapic module was removed in #71

@parthea parthea closed this as completed Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: dataproc Issues related to the googleapis/python-dataproc API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

6 participants