Symlink
python
November 13, 20222 min read

Symlink python3 command to latest python version

Symlink python3 command to run python 3.10 (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.10-config  /usr/bin/python3m
/usr/bin/python3.5  /usr/bin/python3.5m        /usr/bin/python3.7          /usr/bin/python3.7m        /usr/bin/python3.10          /usr/bin/python3-config    /usr/bin/python3m-config

Now, 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.2

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

$ python3 --version
Python 3.10.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
November 20, 20222 min read
Next Article