[Rd] Robust, platform independent method to check for python

Steve Weston steve at revolution-computing.com
Sat Jun 27 23:07:58 CEST 2009


On Sat, Jun 27, 2009 at 4:04 PM, Gabor
Grothendieck<ggrothendieck at gmail.com> wrote:
> I think that most python installations won't have a
> registry key set.  I have python 2.6 and 2.5 on my
> machine but searching the registry found no
> occurrence of the string python.   At least the path method

The Python 2.5 installer from python.org used to
use the registry key "Software\Python\PythonCore",
at least on Windows XP and 2000.  But I don't believe
it ever sets PATH.  I was simply suggesting that if
you want the greatest likelihood of finding python.exe,
you may want to try both methods.  It all depends on
how bullet-proof you want your installation procedure
to be.

> has the advantage that if its not set then the user
> only has to modify the path whereas if its not
> in the registry the user would have to reinstall python
> and to make it worse they would have to use
> specific distributions that install a key. Furthermore
> they would be stuck if they can't access the registry
> on their machine.

If I was to use only one of the two methods, I would
use PATH because it's fairly easy to set PATH, and
it's a more portable solution.  But many of our
Windows users don't know about PATH, so it may
be worth checking in the registry if python.exe isn't
in PATH, rather than requiring the user to do some
manual reconfiguration.

But Vista seems to have changed the registry in
some confusing ways.  It may not be worth the
trouble.

-- 
Steve Weston
REvolution Computing
One Century Tower | 265 Church Street, Suite 1006
New Haven, CT  06510
P: 203-777-7442 x266 | www.revolution-computing.com



More information about the R-devel mailing list