How to solve the "-bash: python: command not found" error on Linux / Unix VPS

How to solve the "-bash: python: command not found" error on Linux / Unix VPS

Direct installation is suitable.

1. Under Ubuntu/Debian
apt-get install python
or
apt-get install python3

2. Oracle/RHEL (Red Hat)/CentOS
yum install python

3. Fedora
dnf install python
or
dnf install python3

4. Under Arch
pacman -S python2
or
pacman -S python3

5. Under Suse/OpenSUSE
zypper install python
or
zypper install python3

6. Install Python v2.x under FreeBSD:
pkg install python2
or
cd /usr/ports/lang/python2/ && make install clean

Install Python v3.x:
pkg install python3
or
cd /usr/ports/lang/python3/ && make install clean

7. OpenBSD
pkg_add python
or
doas pkg_add python

8. MacOS X
brew install python3

confirm:
type -a python
which python
ls -l /usr/bin/python
ls -l /usr/bin/python*

via: https://www.cyberciti.biz/faq/bash-python-command-not-found/

<<:  Optimizing OpenVZ VPS using BBR acceleration

>>:  Yiyun 512MB RAM Los Angeles KVM VPS Review

Recommend

Site5 US Hosting Information

Website address: Site5.com Site5 is a virtual hos...

CloudCone: $1.8/month/512MB memory/10GB SSD space/1TB traffic/KVM/Los Angeles

CloudCone is a relatively active hosting provider...

Easy.gr 50% discount on .gr domains: 12€ for 2 years

Easy.gr, Black Friday .gr domain name discount, y...

PieLayer: $36/year/512MB memory/400GB space/2TB traffic/KVM/Los Angeles/Germany

PieLayer, old and stable. Here are some good pack...