pygmentize command not found

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

Introduction

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

pygmentize: command not found

or when using sudo you get the following error message

sudo: pygmentize: command not found

Solutions to pygmentize: command not found

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

In Ubuntu pygmentize is provided by python3-pygments package.

python3-pygments is:

Pygments aims to be a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.

Highlights are:

  • a wide range of common languages and markup formats is supported
  • special attention is paid to details, increasing quality by a fair amount
  • support for new languages and formats are added easily
  • a number of output formats, presently HTML, LaTeX and ANSI sequences
  • it is usable as a command-line tool and as a library

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

sudo apt-get -y install python3-pygments

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

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

sudo apt -y install python3-pygments

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

sudo aptitude install python3-pygments

Summary

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