Symlink
python
April 12, 20202 min read

Symlink python3 command to run python 3.8 (or any latest python versions)

Symlink python3 command to run python 3.8 (or any latest python versions)

First check which python version you need by running-

$ ls /usr/bin/python3*
/usr/bin/python3    /usr/bin/python3.5-config  /usr/bin/python3.5m-config  /usr/bin/python3.7-config  /usr/bin/python3.7m-config  /usr/bin/python3.8-config  /usr/bin/python3m
/usr/bin/python3.5  /usr/bin/python3.5m        /usr/bin/python3.7          /usr/bin/python3.7m        /usr/bin/python3.8          /usr/bin/python3-config    /usr/bin/python3m-config

Now, to symlink python 3.8 to python, execute the following command in your shell-

$ ln -sf /usr/bin/python3.8 /usr/bin/python3

The above command would have added a symlink of python3.8 to python3. To verify the same, you can run the command-

$ /usr/bin/python3 --version
Python 3.8.2

or even run the python3 command directly to check if the symlink works for Python 3.8-

$ python3 --version
Python 3.8.2

Symlink python3 command to run python 3.10

Similarly to symlink python 3.10 to python, execute the following command in your shell-

$ ln -sf /usr/bin/python3.10 /usr/bin/python3

The above command would have added a symlink of python3.10 to python3. To verify the same, you can run the command-

$ /usr/bin/python3 --version
Python 3.10.0

or even run the python3 command directly to check if the symlink works for Python 3.10-

$ python3 --version
Python 3.10.0

As I've discussed ways to symlink any latest python version to python3 seamlessly, you can symlink to any version of your choice with the above commands.

Share this blog
Tagged in :
python
Like what you read?
Subscribe to our Newsletter
Subscribe to our email newsletter and unlock access to members-only content and exclusive updates.
About the Author
Satvik
Satvik
Entrepreneur
Satvik is a passionate developer turned Entrepreneur. He is fascinated by JavaScript, Operating System, Deep Learning, AR/VR. He has published several research papers and applied for patents in the field as well. Satvik is a speaker in conferences, meetups talking about Artificial Intelligence, JavaScript and related subjects. His goal is to solve complex problems that people face with automation. Related projects can be seen at - [Projects](/projects)
View all articles
Previous Article
Next Article