py command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
py: command not found
or when using sudo you get the following error message
sudo: py: command not found
Solutions to py: command not found
How To Fix py: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu py is provided by pythonpy package.
pythonpy is:
pythonpy is an utility that facilitates the usage of Python one-liners. The command ‘py’ evaluates a string consisting of any Python expression. It can do anything from simple arithmetic to complex operations, importing modules automatically. It also comes with tab completion.
Its usage is not restricted to single expressions only. There’s also the possibility to pipe data from stdin and to stdout, even generating strings to be evaluated by other programs.
To fix this problem, we can install more using the command below.
sudo apt-get -y install pythonpy
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install pythonpy.
sudo apt -y install pythonpy
Or if you have aptitude installed you can use the following command.
sudo aptitude install pythonpy
Summary
In this tutorial we learn how to fix py command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.