I've installed Python in the following locations:
C:\Python\Python27
C:\Python\Python27x86
C:\Python\Python310
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.
CodePudding user response:
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”.