Python Forum
python and py report different versions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python and py report different versions
#4
After a directory and register search, I found that Lilypond and MinGW had installed 'behind my back' Python 2.4.5 and Python 3.8.0, respectively. Since new paths in Windows are appended to the PATH environment variable and I installed Python 3.7.5 last, invoking python.exe resolved to the one in Python 2.4.5 (because I had installed Lilypond before MinGW) and python3.exe to the one in Python 3.8.0 (because there is no python3.exe in Python 2.4.5). As for py.exe, it is in the Windows directory (which has priority over all others) and I assume that (along with pyw.exe) it is replaced by the last Python installed, in this case Python 3.7.5.

The fix has been to move the path of the Python 3.7.5 (which is the one I need at the moment to be the default in my system) higher up in PATH than those of Python 2.4.5 and 3.8.0, and also to ammend the registry keys Computer\HKEY_CLASSES_ROOT\py_auto_file\shell\open\command and Computer\HKEY_CLASSES_ROOT\Python\shell\open\command so that their values point to the python.exe in my Python 3.7.5. (Warning: Tampering with the registry can hang the system.)

Problem solved.

In short: Make sure that the path of the Python you want to be the default in your system is higher up in PATH than that any other, keeping in mind that all sorts of programs install Python for their own use.
Reply


Messages In This Thread
RE: python and py report different versions - by lordvold - Nov-27-2019, 11:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help with Allure report Nik1811 0 180 Apr-22-2024, 09:59 AM
Last Post: Nik1811
  Unable to download TLS Report attachment blason16 6 593 Feb-26-2024, 07:36 AM
Last Post: Pedroski55
  Python Launcher (on Windows) only necessary when 2 or more Python versions installed? pstein 1 354 Feb-17-2024, 12:43 PM
Last Post: deanhystad
  Allure Report Generation rotemz 0 811 Jan-24-2023, 08:30 PM
Last Post: rotemz
Question log.exception() without arguments in old Python versions? cthart 5 1,224 Nov-19-2022, 07:09 PM
Last Post: Gribouillis
  Right to left alignment in python report using Reportlab jalal0034 1 1,866 Sep-27-2022, 04:25 AM
Last Post: jalal0034
  Python versions with libexpat fixes raghupcr 5 2,566 Feb-24-2022, 06:26 PM
Last Post: raghupcr
  Installed versions of Python SamHobbs 5 2,581 Sep-02-2021, 02:28 PM
Last Post: jefsummers
  Print Report Invoice nio74maz 0 1,589 Jun-17-2021, 08:25 AM
Last Post: nio74maz
  Different versions of Python3 and Python Led_Zeppelin 2 2,353 Jun-16-2021, 05:31 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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