Your Question: How Do I Change the Default Python Version in Linux?
Contents

How do I make python3 default in Linux?

To change to python3, you can use the following command in terminal alias python=python3 . to go into the bashrc file and then at the top of the bashrc file make the following change. Check the version of python in your machine.

How do I make Python 2.7 default in Linux?

Add /usr/local/bin to your PATH environment variable, earlier in the list than /usr/bin . This will cause your shell to look first for a python in /usr/local/bin , before it goes with the one in /usr/bin . (Of course, this means you also need to have /usr/local/bin/python point to python2.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest