-bash: python: command not found error and solution
The "command not found" error message you're encountering indicates that the python command is not recognized by your shell because it is not in your shell's PATH.
Here are some steps you can take to resolve this issue:
- Check if Python is installed:
python3 --versionIf Python is installed, the above command will display the version of Python installed on your system. If Python is not installed, you'll need to install it.
- Add the Python executable to your PATH:
~/.bashrc, ~/.bash_profile, or ~/.profile) and adding the following line:export PATH=$PATH:/usr/bin/python3- Restart your shell:
exec $SHELLAfter these steps, the python command should be recognized by your shell, and you should no longer encounter the "command not found" error.
