Looking for tips on running Python version 2.6 and 3.0 together onsame *WINDOWS* machine

  • Thread starter steve.ferg.bitbucket
  • Start date
S

steve.ferg.bitbucket

I'm looking for tips on installing and running Python version 2.6 and
version 3.0 together on same Windows machine.

I'd like to install both 2.6 and 3.0 together on the same Windows
(Vista) machine, so I can test programs under both versions.

Is it possible to install both versions on the same Windows machine in
such a way that they are both asily available and don't interfere with
one another? I'm concerned, for example, that if I install both, the
second installation will over-write some Python entry in the registry.

I'd like something fairly simple -- I will be sharing this information
with others in my workgroup for whom virtualenv is not an option.

I googled around, but couldn't find anything that seemed to address
this specific question. If anybody knows of a URL with this
information (a "2 to 3 Conversion FAQs"?) that would be great.

Any help would be greatly appreciated.

-- Steve Ferg
 
S

Steve Holden

I'm looking for tips on installing and running Python version 2.6 and
version 3.0 together on same Windows machine.

I'd like to install both 2.6 and 3.0 together on the same Windows
(Vista) machine, so I can test programs under both versions.

Is it possible to install both versions on the same Windows machine in
such a way that they are both asily available and don't interfere with
one another? I'm concerned, for example, that if I install both, the
second installation will over-write some Python entry in the registry.

I'd like something fairly simple -- I will be sharing this information
with others in my workgroup for whom virtualenv is not an option.

I googled around, but couldn't find anything that seemed to address
this specific question. If anybody knows of a URL with this
information (a "2 to 3 Conversion FAQs"?) that would be great.

Any help would be greatly appreciated.
It's easy - the registry isn't used except to associate files. The
associations are made with the most-recently-installed version.

I currently have 2.4, 2.5, 2.6 and 3.0 on my Windows machine.

regards
Steve
 
M

Martin v. Löwis

It's easy - the registry isn't used except to associate files. The
associations are made with the most-recently-installed version.

I currently have 2.4, 2.5, 2.6 and 3.0 on my Windows machine.

In addition, at install time, there is the choice of not creating
associations (i.e. links what interpreter should be invoked if you
double-click a .py file, and what version of IDLE should start
when you select Edit from the context menu).

So if you install 2.6 first, then 3.0, but deselect the installation
of associations, 2.6 will continue to be associated with the
..py, .pyw, and .pyc extensions.

Regards,
Martin
 
J

Jason Scheirer

In addition, at install time, there is the choice of not creating
associations (i.e. links what interpreter should be invoked if you
double-click a .py file, and what version of IDLE should start
when you select Edit from the context menu).

So if you install 2.6 first, then 3.0, but deselect the installation
of associations, 2.6 will continue to be associated with the
.py, .pyw, and .pyc extensions.

Regards,
Martin

Technically not true. Python DOES use the registry, but it's per-
version and isolated from each other. Each installs some configuration
data in HKEY_LOCAL_MACHINE\\Software\Python\PythonCore\MAJOR.MINOR, so
you'll have stuff in HKLM\\Software\Python\PythonCore\2.6 and HKLM\
\Software\Python\PythonCore\3.0. And yes, this DOES mean you can't
have 2.6 and 2.6.1 cleanly installed on the machine at the same time.

As long as you keep your .py and .pyw files associated with the
preferred Python interpreter (2.6 I'm assuming) and EXPLICTLY call C:
\Python30\Python.exe when you want to run on 3.0, you're golden.
 
D

Dutch Masters

There is some documentation on the subject at:

http://docs.python.org/using/windows.html

In general, there are several options in maintaining separate
environments:

1) Create a separate user for each environment. This allows you to
keep things such as Path and file associations so that you are
selecting a certain install whenever you are logged in as that user.
This may NOT be an option on Vista though. The Python installer will
tell you whether you can install for only the current user.

2) Use batch scripts to setup your PATH and PYTHONPATH. This will not
solve the file association problem, but you can probably set up your
"SEND TO" folder to handle the different versions.

3) Use something like virtualenv.

I'm using option 2).

A couple more hints: if you are using a windows installer for a third-
party lib, (like wxpython), the installer will look in the registry
for a matching python installation. If there isn't one, it shouldn't
be a problem, just install it where it needs to go. (in the
appropriate Python folder).

You can also use the repair option for the python installer to get the
registry set up for a particular install. For example, if you
installed Python 3, but want to then use associations with 2.6, just
use repair with the 2.6 installer. (Not sure what else repair does
though)

Finally, you can use the --prefix option to setup.py to get installs
to go where you want on win.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top