The kafka library is now called Kafka Python Client (official documentation).
In order to install it, if one is using Anaconda (package page on Anaconda's official site), one can run
conda install kafka-python
Else, one can use
pip install kafka-python
For more information on how to install it, check this page.
There are other Python Clients for Kafka, such as Confluent's Python Client (official documentation).
This one is also available on PyPI so one can install it using pip as follows
pip install confluent-kafka
Notes:
If one is having issues with Python's installation, using the Anaconda Distribution might facilitate things out. If one is using Anaconda, it is recommended to use conda install package
in the environment that one is working on, and use pip
only if it is not available with conda install
.
A while back one had pykafka but it is not maintained anymore.