This issue likely occurs because the python command is not linked to any Python interpreter, while python3 is. To fix it, you can create a symbolic link to make python point to python3. Here’s how:
Open a terminal.
Run the following command (you may need sudo depending on your permissions):
sudo ln -s $(which python3) /usr/bin/python
Now, try running python --version again, and it should display the Python version.
This will allow both python and python3 to reference the same interpreter.