stestr command not found

In this troubleshooting guide we learn how to fix stestr command not found error message

Introduction

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

stestr: command not found

or when using sudo you get the following error message

sudo: stestr: command not found

Solutions to stestr: command not found

How To Fix stestr: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu stestr is provided by python3-stestr package.

python3-stestr is:

Stestr stands for Slim/Super Test Repository. It is a fork of the testrepository that concentrates on being a dedicated test runner for Python projects. The generic abstraction layers which enabled testr to work with any subunit emitting runner are gone. Stestr hard codes python-subunit-isms into how it works. The code base is also designed to try and be explicit, and to provide a Python API that is documented and has examples.

While stestr was originally forked from testrepository it is not 100% backwards compatible with testrepository. At a high level the basic concepts of operation are shared between the 2 projects but the actual usage between the 2 is not exactly the same.

This package contains the Python 3.x module.

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

sudo apt-get -y install python3-stestr

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

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

sudo apt -y install python3-stestr

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

sudo aptitude install python3-stestr

Summary

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