python no module named confluent_kafka

3,770 views
Skip to first unread message

Atharva Inamdar

unread,
Jan 23, 2017, 6:54:49 AM1/23/17
to Confluent Platform
I just pip installed confluent-kafka==0.9.2 and am receiving an error

    from confluent_kafka import Consumer
ImportError: No module named confluent_kafka

I have tried all other versions 0.9.1.1 and 0.9.1.2 . both through the same error.

How would I resolve it?

Atharva Inamdar

unread,
Jan 23, 2017, 7:24:34 AM1/23/17
to Confluent Platform
Within virtualenv here's the output when installing it: 
Collecting confluent-kafka
  Using cached confluent-kafka-0.9.2.tar.gz
Installing collected packages: confluent-kafka
  Running setup.py install for confluent-kafka
    building 'confluent_kafka.cimpl' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c confluent_kafka/src/confluent_kafka.c -o build/temp.linux-x86_64-2.7/confluent_kafka/src/confluent_kafka.o
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c confluent_kafka/src/Producer.c -o build/temp.linux-x86_64-2.7/confluent_kafka/src/Producer.o
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c confluent_kafka/src/Consumer.c -o build/temp.linux-x86_64-2.7/confluent_kafka/src/Consumer.o
    gcc -pthread -shared build/temp.linux-x86_64-2.7/confluent_kafka/src/confluent_kafka.o build/temp.linux-x86_64-2.7/confluent_kafka/src/Producer.o build/temp.linux-x86_64-2.7/confluent_kafka/src/Consumer.o -L/usr/lib64 -lrdkafka -lpython2.7 -o build/lib.linux-x86_64-2.7/confluent_kafka/cimpl.so
Successfully installed confluent-kafka


and when doing pip show:
> pip show confluent-kafka
You are using pip version 6.0.8, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


Looks like it is not being installed correctly. I have librdkafka 0.9.1 installed on the machine.

the module is found if I install the package globally and run it without virtualenv.

How can I make sure it runs in virtualenv?

Thanks,
Atharva

Ewen Cheslack-Postava

unread,
Jan 31, 2017, 12:50:56 AM1/31/17
to Confluent Platform
Could you list full contents if your virtualenv directory? It looks like it compiled the C module successfully, so it'd be odd to not find the module at all.

-Ewen

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsubscribe@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/59c93a57-cd5f-4ad6-a8d7-a0478e443ee6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages