![]() ![]() ![]() To know the Python version on Linux, follow these three steps: As a result, you get the version number below your command.Type python -V into the Terminal window and hit enter.Open up a Terminal window by hitting Command-Space and typing in “Terminal”.Type python -version into the command propmpt window and hit enter.Press enter to launch the Powershell app. Open the command prompt by pressing the Windows key and typing in “command prompt”.Type python -version into the Powershell window and hit enter.įigure out your Python version on Windows 7 OS with these steps:.Open the Powershell by pressing the Windows key and typing in “powershell”.Windows 10įigure out the Python version on your Windows 10 OS with these steps: This returns the version info of your Python3. If you are using Python3 and want to know its version, repeat the above steps but instead of typing python -V, type python3 -V. Here is a table that shows how to check the Python version on any environment: Environment How to Check Python Version on Any Environment Next, let’s see system-specific guides on how to use command-line tools to get the version info. Now you know all the ways you can get the version info about Python. Or if you want to get the version info as a tuple: import platform Output (example): sys.version_info(major=3, minor=9, micro=0, releaselevel='final', serial=0) Use the Platform ModuleĪnother way to access the version information on a Python script is by using the platform module. Or if you want to get this info as a tuple, access the version_info property: import sys To get the basic version information directly from a Python script, use the built-in sys module: import sys But what if you want to check the version from a script directly? Now you know how to check your Python version on a command-line tool. ![]() Running -VV on < Python 3.6 does not show the additional info. Notice, however, that this option was added to Python 3.6+. This command gives you more detailed version information. To get more specific version information of Python3, run python3 -VV: $ python3 -VV This is just a shorthand for python -version. But there are other commands too.Īlternatively, you can use python -V too. The clearest way to figure out the Python version is running python -version on a command-line application. How to Check Your Python Version Overview
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |