viakda.blogg.se

Linux check python version
Linux check python version











linux check python version

How to find my IP address on Ubuntu 20.04 Focal Fossa Linux.How to install the NVIDIA drivers on Ubuntu 20.04 Focal Fossa Linux.Python 3 $ python3 check-python-version.py Python 2 $ python check-python-version.py Make sure to use appropriate Python interpreter such as python or python3. Once ready run the check-python-version.py script to obtain python version. Save the below python code as a new file named check-python-version.py: import platform The following script will check python version and print the version number to the standard output. Type "help", "copyright", "credits" or "license" for more information. Instead of retrieving the python version from the linux command line we can ask directly the python interpreter to perform version check. Next, we are going to retrieve the version number from the command line: Python 2 $ /usr/bin/python -VĬheck Python Version by using interpreter As you can see our system has both Python 2 and Python 3 versions installed. Another path the Python binaries can be installed in is /usr/local/bin/.

linux check python version

Please note the action minor python version may differ from system to system.

linux check python version

usr/bin/python /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3m List installed python binary executable to see what version is installed on your system: $ ls /usr/bin/python* You system may have both Python 2 and Python 3 version installed. $ – requires given linux commands to be executed as a regular non-privileged user.# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command.You will learn how to check for python version using the python command as well as how to determine the python version programmatically, from python console and using python script. The following article will provide you with the information on how to check Python Version on your operating system.













Linux check python version