2

I am trying to run Python2.7 and Python3.2 on the same windows machine. I have seen several questions on this before like the one linked below.

Is it possible to install python 3 and 2.6 on same PC?

I do not have problems installing the two different versions, but when I try to run a python program I have to specify that I want to run in Python2.7 and then it will run fine. But if I try to specify to run it in Python3.2 it does not run.

When I look at my PYTHONPATH it only contains Python2.7 so I guess it is searching for imports in Python2.7 and there it is getting problems. So would I have to manually change the PYTHONPATH and replace Python27 with Python32?

Community
  • 1
  • 1
  • For a [clean, official solution, install Python 3.3](http://stackoverflow.com/a/13297878/194586), which includes the [Python Launcher for Windows](http://blog.python.org/2011/07/python-launcher-for-windows_11.html) – Nick T Nov 08 '12 at 21:45

1 Answers1

2

So would I have to manually change the PYTHONPATH and replace Python27 with Python32?

Yes.

Amber
  • 507,862
  • 82
  • 626
  • 550
  • And if I modify the PYTHONPATH with a python script it will be changed back to Python27 when the script finishes? So I have to manually change the path in Windows? – RustyJuggler Mar 12 '12 at 08:04
  • Well, you can use the `SET` command to modify an environment variable (e.g. `PYTHONPATH`) in a particular shell (command window) for the life of that shell, but after you close that shell it will revert to its original value, yes. If you want to change it persistently, you'd need to change it in Windows. – Amber Mar 12 '12 at 08:11