Here's a step-by-step guide:
- Open a terminal.
- Install the
python-is-python3
package which will set Python 3 as the default when you use thepython
command: bash sudo apt install python-is-python3 - If you have multiple versions of Python 3 and want to set a specific one (e.g., Python 3.8) as the default for the
python3
command, useupdate-alternatives
:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
- You can then configure the default version by running:
sudo update-alternatives --config python3
Follow the on-screen instructions to select the default Python 3 version.
- Verify the change by checking the Python version:
python3 --version
Top comments (0)