Reputation: 66304
What would be the best way/order to install both 32 and 64 bit versions of Python 2.7 and Python 3.3 if I want 64 bit Python 3.3 to be the default when I open .py files?
I already have the 32 bit version of each installed, with defaults set to Python 3.3.
If it is fine to just rename the directory of my currently installed version, will python27.dll and programmes using it (or python33.dll) continue to work? This library gets installed to %WINDIR%\System32 and/or %WINDIR%\SysWoW64 by the python installer.
Thanks for your answers, here is what I did:
C:\Python\27_32\
C:\Python\27\
C:\Python\33_32\
C:\Python\33\
Upvotes: 6
Views: 922
Reputation: 104702
Use the PEP 397 launcher and configure it to launch your preferred version of Python. A copy comes with all versions of Python 3.3, or you can install it separately.
To elaborate:
Rather than launching Python by typing python
in a shell, run py.exe
(this should also be the default action for double clicking on a Python file if the most recently installed version is Python 3.3 or later). py.exe
is a helper program that searches for and locates an appropriate version of Python on your system.
You can edit an .ini
file in various locations to specify the default version, or your Python scripts can specify the version they expect to be run with (using a "shebang" line, as described in the PEP). So you can set your system default to be 64-bit Python 3.3, while also allowing individual scripts to use other versions on demand.
Upvotes: 2
Reputation: 251365
The installer typically has an option for "Set file associations" that handles that, and I think it's on by default, which means that the most-recently-installed one will handle double-clicking .py files. So install 64-bit Python 3.3 last and it should work. I just did this a few days ago with 32- and 64-bit version of 2.7 and it seems to work fine.
I wouldn't rename your existing directory, though. You should install each version of Python in its own directory.
Upvotes: 3
Reputation: 113905
I would use a virtualenv for each version (2.7/3.2) or flavor (32-bit/64-bit) of python you want to install. Essentially, a virtualenv is a sandbox for your installation, which doesn't leak through into other sandboxes.
This other SO question explains how to make virtualenvs
Upvotes: -1