Python Forum
Unable to verify python versio
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to verify python versio
#1
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
Reply
#2
(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.
Recommended Tutorials:
Reply
#3
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.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to verify widening conversion? quazirfan 1 632 Apr-08-2023, 07:04 AM
Last Post: Gribouillis
  Verify input as integer and not blank GMCobraz 3 2,137 Jun-22-2020, 02:47 PM
Last Post: pyzyx3qwerty
  How to verify the give number is valid Mekala 3 2,407 May-16-2020, 02:40 PM
Last Post: anbu23
  Unable to install python-wnck python-imaging on Void Linux linuxlight 1 3,208 Mar-08-2020, 03:53 AM
Last Post: Larz60+
  Verify if .docx table of contents is updated as per document sections or not vintysaw 0 3,884 Oct-24-2019, 12:01 PM
Last Post: vintysaw

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020