+1 vote
3 views
ago in Cloud by
python --version is not displaying any output, while python3 --version is working. How can I fix this?

1 Answer

0 votes
ago by
 
Best answer

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:

  1. Open a terminal.

  2. Run the following command (you may need sudo depending on your permissions):

    sudo ln -s $(which python3) /usr/bin/python

  3. 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.

...