yapf-diff command not found

In this troubleshooting guide we learn how to fix yapf-diff command not found error message

Introduction

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

yapf-diff: command not found

or when using sudo you get the following error message

sudo: yapf-diff: command not found

Solutions to yapf-diff: command not found

How To Fix yapf-diff: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu yapf-diff is provided by yapf3 package.

yapf3 is:

Yapf is a tool that reformats code to the best formatting that conforms to the style guide. It is not only concerned with lint errors, but also with the stylistic appearance of Python code. The idea is also similar to the ‘gofmt’ tool for the Go programming language. This package installs the tool for Python

This package provides the command-line interface for Python 3.

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

sudo apt-get -y install yapf3

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

You can also use apt command to install yapf3.

sudo apt -y install yapf3

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

sudo aptitude install yapf3

Summary

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