gRPC python setup example raises ImportError: No module named early_adopter

1,326 views
Skip to first unread message

Jesper Petersén

unread,
May 26, 2016, 8:42:18 AM5/26/16
to Google Cloud Pub/Sub Discussions
Hi,
Trying out Google Pub/Sub using gRPC, following the instructions on https://cloud.google.com/pubsub/grpc-python#setup

This doesn't work properly and I get "ImportError: No module named early_adopter", see full example below.
Downgrading grpcio to 0.13 seems to make it work though. How can I run the latest grpcio or is it simply not supported yet?

(test-grpc)😊  ~/projects/test-grpc pip install grpc-google-pubsub-v1
Collecting grpc-google-pubsub-v1
Collecting grpcio>=0.13.1 (from grpc-google-pubsub-v1)
Collecting oauth2client>=1.4.11 (from grpc-google-pubsub-v1)
Collecting googleapis-common-protos>=1.1.0 (from grpc-google-pubsub-v1)
Collecting six>=1.10 (from grpcio>=0.13.1->grpc-google-pubsub-v1)
 
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting protobuf>=3.0.0a3 (from grpcio>=0.13.1->grpc-google-pubsub-v1)
 
Using cached protobuf-3.0.0b3-py2-none-any.whl
Collecting futures>=2.2.0 (from grpcio>=0.13.1->grpc-google-pubsub-v1)
 
Using cached futures-3.0.5-py2-none-any.whl
Collecting enum34>=1.0.4 (from grpcio>=0.13.1->grpc-google-pubsub-v1)
 
Using cached enum34-1.1.6-py2-none-any.whl
Collecting pyasn1-modules>=0.0.5 (from oauth2client>=1.4.11->grpc-google-pubsub-v1)
 
Using cached pyasn1_modules-0.0.8-py2.py3-none-any.whl
Collecting rsa>=3.1.4 (from oauth2client>=1.4.11->grpc-google-pubsub-v1)
 
Using cached rsa-3.4.2-py2.py3-none-any.whl
Collecting pyasn1>=0.1.7 (from oauth2client>=1.4.11->grpc-google-pubsub-v1)
 
Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting httplib2>=0.9.1 (from oauth2client>=1.4.11->grpc-google-pubsub-v1)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Users/datamaskinen/.virtualenvs/test-grpc/lib/python2.7/site-packages (from protobuf>=3.0.0a3->grpcio>=0.13.1->grpc-google-pubsub-v1)
Installing collected packages: six, protobuf, futures, enum34, grpcio, pyasn1, pyasn1-modules, rsa, httplib2, oauth2client, googleapis-common-protos, grpc-google-pubsub-v1
Successfully installed enum34-1.1.6 futures-3.0.5 googleapis-common-protos-1.1.0 grpc-google-pubsub-v1-1.0.15 grpcio-0.14.0 httplib2-0.9.2 oauth2client-2.1.0 protobuf-3.0.0b3 pyasn1-0.1.9 pyasn1-modules-0.0.8 rsa-3.4.2 six-1.10.0
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(test-grpc)😊  ~/projects/test-grpc cd cloud-pubsub-samples-python/grpc
(test-grpc)😊  ~/projects/test-grpc/cloud-pubsub-samples-python/grpc git:(master) ✓ python pubsub_sample.py
Traceback (most recent call last):
 
File "pubsub_sample.py", line 25, in <module>
   
from google.pubsub.v1 import pubsub_pb2
 
File "/Users/datamaskinen/.virtualenvs/test-grpc/lib/python2.7/site-packages/google/pubsub/v1/pubsub_pb2.py", line 1168, in <module>
   
from grpc.early_adopter import implementations as early_adopter_implementations
ImportError: No module named early_adopter
(test-grpc)💔  ~/projects/test-grpc/cloud-pubsub-samples-python/grpc git:(master) ✓

Nick

unread,
May 30, 2016, 4:57:07 PM5/30/16
to Google Cloud Pub/Sub Discussions
Hey Jesper,

I've replicated what the same issue you saw when following the instructions, although I noticed that my machine downloaded grpcio-0.14.0, which is a version ahead of the one your machine saw. This doesn't appear to be a significant difference. We'll be looking into the cause of this and will update this thread with any information as soon as we have any more insight.

One small thing to add, in future, be sure to post threads like these to Stack Overflow, since that site is explicitly designed for specific issue technical support, while this forum is intended for more general discussion of the platform, services, and various patterns, architecture choices, etc. We monitor there as well.

Cheers,

Nick
Cloud Platform Community Support

Kir Titievsky

unread,
May 31, 2016, 8:09:52 AM5/31/16
to Nick, Google Cloud Pub/Sub Discussions

Hey, Jesper,

Thanks for posting.  Looks like we are able to reproduce this. One thing to try while we figure this out is a fresh Python virtualenv, unless you are already doing that. Is there a feature in 0.14 that you were counting on?

k

Kir Titievsky / Product Manager / Google Cloud Pub/Sub

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/64415205-ee2f-4337-86d0-852194d4e36f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages