5
votes

I'm using windows xp.

I'm trying to use Python in powershell. On my computer I have both Python 3.3 and 2.7 installed. I'm trying to run 2.7 but whenever I type "python" into powershell it opens 3.3.

How do I select the version of Python to run?

2
Do you want to change default python version? - arulmr
What about python2 or python27? - Waleed Khan

2 Answers

10
votes

In powershell, enter the following:

$Env:PY_PYTHON = 2

Then try using the command "py". It should start up Python 2.7. If you ever want to run Python 3.3 again, "py -3" will do the trick.

1
votes

Something like Python Select? Windows support is experimental but it might be worth a try.

https://github.com/Activestate/pythonselect

There's also switchpy, although that only supports up to Python 3.2.

apipes.blogspot.com/2010/10/switchpy.html?m=1