Adrian
Adrian

Reputation: 373

What is the difference between python -V and py -V?

I want to get the current python that I am using!

My output currently is:

python -V
Python 3.7.3

py -V
Python 3.6.8

What is the difference between these two commands? I have anaconda and Python installed (Python 3.7 with anaconda). I think this could be a reason but I don't know why.

which python displays:

which python
/c/Users/USER/AppData/Local/Continuum/anaconda3/python

which py
/c/windows/py

Upvotes: 1

Views: 1893

Answers (1)

TomMP
TomMP

Reputation: 815

The two commands point to two different Python interpreters on your system. You can run which py or which python to see where they are located, if you are interested.

Managing different python versions in one system without the use of virtual environments can lead to headaches, for example when you install a package for the wrong interpreter. I would definitely recommend looking into virtualenv and/or virtualenvwrapper.

Upvotes: 1

Related Questions