Z
Z
zlodiak2019-10-23 23:43:35
linux
zlodiak, 2019-10-23 23:43:35

How to find out which version of python you are using?

Please help me understand why I see different versions of python through the command line.

[email protected] ~/.MINT17/code/python/alien_invasion $ python -V
Python 3.7.0
[email protected] ~/.MINT17/code/python/alien_invasion $ python3 -V
Python 3.4.3
[email protected] ~/.MINT17/code/python/alien_invasion $ virtualenv -p python3.4 venv
Running virtualenv with interpreter /usr/bin/python3.4
Using base prefix '/usr'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip...done.
[email protected] ~/.MINT17/code/python/alien_invasion $ 
[email protected] ~/.MINT17/code/python/alien_invasion/venv/bin $ source activate
(venv)[email protected] ~/.MINT17/code/python/alien_invasion/venv/bin $ python -V
Python 3.7.0
(venv)[email protected] ~/.MINT17/code/python/alien_invasion/venv/bin $ python3 -V
Python 3.4.3

As you can see, the commands
python -V
and
python3 -V
show different versions. And even when virtualenv is enabled. How is this possible?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pestilence_brain, 2019-10-24
@zlodiak

It shows different versions, apparently due to console autoconfiguration when installing Python. So maybe when installing Python 3.7.0 the "path" command for the console stuck as python and python3 as version 3.4.3

R
Radjah, 2019-10-24
@Radjah

ls -la `which python`
ls -la `which python3`

And so you can guess for a long time.

V
Valentine, 2019-10-31
@ProFfeSsoRr

How is this possible?

Obviously, there are 2 different versions of the python, and once you installed them yourself, they won’t come from nowhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question