jsonpath.py command not found

In this troubleshooting guide we learn how to fix jsonpath.py command not found error message

Introduction

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

jsonpath.py: command not found

or when using sudo you get the following error message

sudo: jsonpath.py: command not found

Solutions to jsonpath.py: command not found

How To Fix jsonpath.py: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu jsonpath.py is provided by python3-jsonpath-rw package.

python3-jsonpath-rw is:

This library provides a robust and significantly extended implementation of JSONPath for Python. It is tested with Python 2.6, 2.7, 3.2, and 3.3.

This library differs from other JSONPath implementations in that it is a full language implementation, meaning the JSONPath expressions are first class objects, easy to analyze, transform, parse, print, and extend.

The JSONPath syntax supported by this library includes some additional features and omits some problematic features (those that make it unportable). In particular, some new operators such as “|” and “where” are available, and parentheses are used for grouping not for callbacks into Python, since with these changes the language is not trivially associative. Also, fields may be quoted whether or not they are contained in brackets.

This package provides the Python 3.x module.

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

sudo apt-get -y install python3-jsonpath-rw

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

You can also use apt command to install python3-jsonpath-rw.

sudo apt -y install python3-jsonpath-rw

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

sudo aptitude install python3-jsonpath-rw

Summary

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