Check the python version your machine currently using by typing the following commands in your terminal.
bash-5.1$ python --version
Python 3.9.12
Check the python version via the python script.
#import sys module in python sys module contain tuple of strings containing all the built in modules and constants
import sys
print(sys.version) #get the python version
Check which version you are using if you have multiple python versions installed.
You can check what version of python you are using by typing python in
the terminal.
bash-5.1$ python
Python 3.9.12 (main, Apr 5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Check the python interpreter location using the terminal.
To check the python interpreter location type command which python
command.
(base) bash-5.1$ which python
/home/username/anaconda3/bin/python
No comments:
Post a Comment