Google Certified Professional Data Engineer

Sign Up Free or Log In to participate!

LAB: Stream Data Through Cloud Pub/Sub to Big Query – Issue

Hello, I’m receiving the error below from the terminal using the default py file. 

Can you tell me how/where to fix the issue?

Traceback (most recent call last):

File "transactions.py", line 3, in

from google.cloud import pubsub_v1

ImportError: cannot import name pubsub_v1

Thanks,

Zack

1 Answers

Hi Zachary

Sorry you’re having problems with this lab. First please make sure you’ve installed the necessary library in the Cloud Shell terminal with:

sudo pip3 install google-cloud-pubsub

When this video was recorded, the shell would default to Python 3, but I just tried it and for some reason that’s no longer the case. So you need to specify Python 3 when you run the script with:

python3 transactions.py

Hope this helps!

Thanks

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?