Python Forum

Full Version: Unable to verify python versio
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, yesterday I installed 3.8.1 version of python and node.js. When I installed node.js afterwords and clicked install all requirements I saw as it was running that it installed another version. a 2.7 along with it, when I when to check which version was being used in cmd it came back as 2.7, so I tried to change it using a command I found on google and ever since it returns no value and just skips to another line for my to input another command. I uninstalled and reinstalled everything but the problem remains. In the Python cmd I input import sys
print(sys.version) and it returns with the 3.8.1 version as well as says it at the top but I want to make sure my computer is recognizing it. I use a windows 10 os, any help would be appreciated. ty
(Jan-14-2020, 10:18 PM)ThereIsNoSpoom Wrote: [ -> ]when I when to check which version was being used in cmd it came back as 2.7
What are you running to return python 2.7 version in your console?

If you type python in the console and get python 3.8.1 then you have that installed properly. However other programs may use older versions of python still and they install another python interpreter separately. That would not mean you need to update it. You would just use the python 3.8.1 interpreter to run code you have written.
Try following:

py -3
and
py -2
I guess py -3 fires up the right interpreter (3.8.1).
If py -2 is complaining, that Python 2 is not installed, then you know it's not a system wide installation.
Maybe node.js has this strange dependency?! I guess not.

To get more information, you could print the sys.executable

import sys


print(sys.executable)
Output:
c:\users\admin\appdata\local\programs\python\python38\python.exe
So in my case the interpreter is installed by an normal privileged user and not system wide.
The shortcut to the local app directories of any user is:

%localappdata%

As normal user installation you could find Python here: %localappdata%\Programs\Python\Python38

If the application is installed for the system, you'll find it in %programfiles% for 64bit arch and in %programfiles(x86)% for 32bit.