Find all python versions mac8/21/2023 ![]() If this utility is available in your system then you need to simply run compgen -c python | grep -P '^python\d' command to list out all the versions of python installed in the system. ls -ls /usr/bin/python*Ġ lrwxrwxrwx 1 root root 9 /usr/bin/python2 -> python2.7ģ580 -rwxr-xr-x 1 root root 3662032 /usr/bin/python2.7Ġ lrwxrwxrwx 1 root root 9 Nov 15 20:46 /usr/bin/python3 -> python3.8ĥ368 -rwxr-xr-x 1 root root 5494584 Nov 14 18:29 /usr/bin/python3.8ĥ668 -rwxr-xr-x 1 root root 5803968 /usr/bin/python3.9Ĥ -rwxr-xr-x 1 root root 384 /usr/bin/python3-futurizeĤ -rwxr-xr-x 1 root root 388 /usr/bin/python3-pasteurizeĪnother method that you can think of using is through compgen command. You can check more about ls command on 16 Best ls command examples in Linux. Using this command, you just need to look for all the python binaries available under /usr/bin path to detect all the versions of python currently installed as shown below. This command is also very easily available on almost all the linux distribution. The second method that I always love to use is through ls command. whereis python2 python2: /usr/bin/python2.7 /usr/bin/python2 /usr/lib/python2.7 /etc/python2.7 /usr/local/lib/python2.7 /usr/share/man/man1/python2.1.gz Similarly, if you would like to check all the installed versions of python2 then you need to use whereis python2 command as shown below. whereis python3 python3: /usr/bin/python3 /usr/bin/python3.8 /usr/bin/python3.9 /usr/lib/python3 /usr/lib/python3.8 /usr/lib/python3.9 /etc/python3 /etc/python3.8 /etc/python3.9 /usr/local/lib/python3.8 /usr/local/lib/python3.9 /usr/include/python3.8 /usr/share/python3 /usr/share/man/man1/python3.1.gz This works great in almost all the linux systems. So if you are looking for all the versions of python3 then you just need to run whereis python3 command and you will able to see all the python3 versions as shown below. The first method you can think of using is through whereis command which is easily available in almost all the linux distributions. How to Check all the Python Versions Installed on LinuxĪlso Read: How to Install Ansible on Ubuntu 20.04 LTS (Focal Fossa) Method 1: Using whereis command ![]() While there are many ways to check this but here we will only see four methods that can be used in a linux system to detect all the python versions. Well, at that point of time you probably would like to know all the python versions installed on your System. And some day you only realize this when you started getting certain strange messages on the output pointing different versions of python available in the System. ![]() Many times you might have noticed that either knowingly or unknowingly you end up installed multiple python versions in your linux system. In this article, we will see how to check all the python versions installed on a Linux system. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |