Justen
Justen

Reputation: 4869

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

How would I do this? The reason being I wanted to try some pygame out, but I have python 3 installed currently and have been learning with that. I'm also interested in trying out wxpython or something like that, but I haven't looked at their compatibilities yet.

EDIT:: im on a windows vista 64-bit

Upvotes: 3

Views: 1892

Answers (7)

Soviut
Soviut

Reputation: 91545

You can set up virtual python environments using virtualenv.

Upvotes: 0

Patrick Gryciuk
Patrick Gryciuk

Reputation: 712

Yes, it is possible.

I maintain 3 python installations (2.5, 2.6, 3.0). The only issue that could be confusing is figuring out which Python version takes precedence in PATH variable (if any) . To execute a script for a specific version, you would go into the python directory for that version

C:\Python25\ , C:\Python26\, C:\Python30\, etc.

Drop the file in there, and run "python.exe file.py" from command-line.

You could even rename each python.exe to python25.exe python26.exe python30.exe and have each directory in PATH so it would be easy to execute any script on any version.

Upvotes: 2

dwc
dwc

Reputation: 24890

Typically python is installed with a name like python2.6, so you can have more than one. There may be a symlink from python to one of the numbered files. Quite workable.

Upvotes: 3

Samir Talwar
Samir Talwar

Reputation: 14330

Erm... yes. I just installed Python 3.0 on this computer to test it. You haven't specified your operating system, but I'm running Ubuntu 9.04 and I can explicitly specify the version of Python I want to run by typing python2.5 myscript.py or python3.0 myscript.py, depending on my needs.

Upvotes: 3

Charlie Martin
Charlie Martin

Reputation: 112366

You certainly can. On Mac Ports, there's a tool called python_select that lets you switch among python versions; if nothing like it exists on Windows (momentary googling didn't reveal one), it could certainly be written.

Upvotes: 1

van
van

Reputation: 76992

If you are on Windows, then just install another version of Python using the installer. It would be installed into another directory.

Then if you install other packages using the installer, it would ask you for which python installation to apply. If you use installation from source or easy_install, then just make sure that when you install, you are using the one of the proper version.

If you have many packages installed in your current python-3, then just make a zip backup of your current installation just in case.

Upvotes: 9

overslacked
overslacked

Reputation: 4137

I would assume it'd be the same as running two versions of 2.x; as long as they're each in their own directory you should be OK.

Upvotes: 1

Related Questions