Skip to content

.cimpl problems #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericywho opened this issue Sep 8, 2016 · 5 comments
Closed

.cimpl problems #41

ericywho opened this issue Sep 8, 2016 · 5 comments

Comments

@ericywho
Copy link

ericywho commented Sep 8, 2016

I'm new to this package.

I just did:

sudo apt-get install librdkafka1
sudo apt-get install librdkafka-dev
sudo apt-get install libssl-dev
sudo apt-get install liblz4-dev
sudo apt-get install libsasl2-dev
git clone https://github.com/confluentinc/confluent-kafka-python.git
cd confluent-kafka-python; ./configure ; make ; sudo make install

This seemed to install everything into /usr/local/

sudo pip install confluent-kafka

ubuntu$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from confluent_kafka import Consumer, KafkaError
Traceback (most recent call last):
File "", line 1, in
File "confluent_kafka/init.py", line 2, in
from .cimpl import *
ImportError: No module named cimpl

@edenhill
Copy link
Contributor

edenhill commented Sep 8, 2016

Hi

cd confluent-kafka-python; ./configure ; make ; sudo make install

I'm not sure about that one, there's no configure or make install target in confluent-kafka-python.

sudo pip install confluent-kafka

Can you try installing to a virtualenv?

virtualenv /tmp/venv
source /tmp/venv/bin/activate
pip install confluent-kafka
python
from confluent-kafka import KafkaConsumer

Also make sure that you are install librdkafka1 version 0.9.1 or later, it is available from Confluent and Debian

@ericywho
Copy link
Author

ericywho commented Sep 8, 2016

Doing this in virtualenv seems to work now, at least for Producer.
How do I connect via SSL ? Or I'm connecting via SSL already ?
Thanks

>>> from confluent_kafka import Producer

>>> p = Producer({'bootstrap.servers': 'kaf1'})

>>> p.produce('test', "hello")

>>> p.flush()

>>> p.produce('test', 'yet another message')

>>> p.flush()
On Thu, Sep 8, 2016 at 1:04 PM, Magnus Edenhill [email protected]
wrote:

from confluent-kafka import KafkaConsumer

-eric ho

@edenhill
Copy link
Contributor

edenhill commented Sep 8, 2016

Great!

See this guide for how to set up SSL with librdkafka based clients:
https://github.com/edenhill/librdkafka/wiki/Using-SSL-with-librdkafka

@edenhill edenhill closed this as completed Sep 8, 2016
@mtrienis
Copy link

mtrienis commented Feb 7, 2017

Turns out that you run into this error if you import confluent_kafka while you're in the source folder of confluent_kafka:

[shell]# pwd
/src/confluent-kafka-python
>>> import confluent_kafka
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "confluent_kafka/__init__.py", line 2, in <module>
    from .cimpl import (Consumer,
ImportError: No module named cimpl
>>> 

If you CD to a path that is NOT in /src/confluent-kafka-python then it will work as expected.

@Anku1024
Copy link

Anku1024 commented Apr 15, 2024

@mtrienis mtrienis can you explain it, i did pip install package and facing issue, and this is in init file, so not sure how to resolve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants