kafka-tools command not found

In this troubleshooting guide we learn how to fix kafka-tools command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

kafka-tools: command not found

or when using sudo you get the following error message

sudo: kafka-tools: command not found

Solutions to kafka-tools: command not found

How To Fix kafka-tools: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu kafka-tools is provided by python3-pykafka package.

python3-pykafka is:

PyKafka is a programmer-friendly Kafka client for Python. It includes Python implementations of Kafka producers and consumers, which are optionally backed by a C extension built on librdkafka. It runs under Python 2.7+, Python 3.4+, and PyPy, and supports versions of Kafka 0.8.2 and newer.

PyKafka’s primary goal is to provide a similar level of abstraction to the JVM Kafka client using idioms familiar to Python programmers and exposing the most Pythonic API possible.

To fix this problem, we can install more using the command below.

sudo apt-get -y install python3-pykafka

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install python3-pykafka.

sudo apt -y install python3-pykafka

Or if you have aptitude installed you can use the following command.

sudo aptitude install python3-pykafka

Summary

In this tutorial we learn how to fix kafka-tools command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.