If i type "python3.7 --version" into terminal: result is: Python 3.7.3 If i type "/usr/bin/python3 -V" into terminal: result is: Python 3.6.7 Since this entry i installed pip and then ran "python --version" as advised by https://packaging.python.org/tutorials/installing-packages/#ensure-you-can-run-python-from-the-command-line result now is Python 2.7.15rc1 I am trying to learn Python from scratch. I am using Visual Studio Code and i have run into a problem. When i run terminal in Visual Studio Code; which version of Python will it be using?
Ubuntu 18.04 uses 3.6.7 by default, so this is the expected result from running
/usr/bin/python3 linked to python 3.6.7.
You can link it to your desired python version, but this is not preferable way because it might break things and create incompatibility. Instead, you can create alias to make
python command behaves as your desire python version.
emmet@ansmachine:~$ alias python=/usr/bin/python3.7 emmet@ansmachine:~$ python --version Python 3.7.1
The "which" command can be useful for things like this, it will tell you the pathname of the file that will be executed by a given command.
tells you which file will be executed by the "python" command, and
tells you which file will be executed by the python3 command. Since you appear to have a separate python3.7 command you can check that also using