Skip to content
Advertisement

I have Python 3 x64, Python 2.7 x64, and Python 2.7 x32 installed. How can I use py launcher to switch to the 32 bit version of Python 2.7?

I’ve installed Python in the following locations:

C:PythonPython27
C:PythonPython27x86
C:PythonPython310

Here are the current version strings for each install:

Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] on win32

Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:19:08) [MSC v.1500 32 bit (Intel)] on win32

Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32

My Issue

When I enter py -2.7 I get the 64 bit environment of Python2.7. I want to be able to also switch to the 32 bit version of Python 2.7 using py. How can I do this?

Any help is greatly appreciated.

Advertisement

Answer

Use py -2.7-32. See Customizing default Python versions:

In some cases, a version qualifier can be included in a command to dictate which version of Python will be used by the command. A version qualifier starts with a major version number and can optionally be followed by a period (‘.’) and a minor version specifier. Furthermore it is possible to specify if a 32 or 64 bit implementation shall be requested by adding “-32” or “-64”.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement