Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Coexistence of Python 2.x and 3.x on same OS

Reply
Thread Tools

Coexistence of Python 2.x and 3.x on same OS

 
 
Edward Diener
Guest
Posts: n/a
 
      09-30-2012
Has there been any official software that allows both the Python 2.x and
3.x releases to coexist on the same OS so that the end-user can easily
switch between them when invoking Python scripts after each has been
installed to their own directories/folders ?

I know of some unoffical solutions, but they require lots of tweaks.
Given the vagaries of the different OSs on which Python can run I am
hoping for some offical solution which will work on any of the most
popular OSs ( Windows, Linux, Mac ).

The situation is so confusing on Windows, where the file associations,
registry entries, and other internal software which allows a given
Python release to work properly when invoking Python is so complicated,
that I have given up on trying to install more than one Python release
and finding a relaible, foolproof way of switching between them. So
although I would like to use the latest 3.x series on Windows I have
decide to stick with the latest 2.x series instead because much software
using Python does not support 3.x yet.
 
Reply With Quote
 
 
 
 
Andrew Berg
Guest
Posts: n/a
 
      09-30-2012
On 2012.09.30 14:14, Edward Diener wrote:
> The situation is so confusing on Windows, where the file associations,
> registry entries, and other internal software which allows a given
> Python release to work properly when invoking Python is so complicated,
> that I have given up on trying to install more than one Python release
> and finding a relaible, foolproof way of switching between them. So
> although I would like to use the latest 3.x series on Windows I have
> decide to stick with the latest 2.x series instead because much software
> using Python does not support 3.x yet.


http://www.python.org/dev/peps/pep-0397/

Unix-based OSes should already obey the shebang line, and on Windows,
there's py.exe in 3.3 that will launch the intended version based on
that shebang line. While I was using the alpha/beta versions of 3.3, I
had no problems invoking either 3.2 or 3.3 with the shebang line on Windows.
--
CPython 3.3.0 | Windows NT 6.1.7601.17835
 
Reply With Quote
 
 
 
 
Edward Diener
Guest
Posts: n/a
 
      10-01-2012
On 9/30/2012 3:38 PM, Andrew Berg wrote:
> On 2012.09.30 14:14, Edward Diener wrote:
>> The situation is so confusing on Windows, where the file associations,
>> registry entries, and other internal software which allows a given
>> Python release to work properly when invoking Python is so complicated,
>> that I have given up on trying to install more than one Python release
>> and finding a relaible, foolproof way of switching between them. So
>> although I would like to use the latest 3.x series on Windows I have
>> decide to stick with the latest 2.x series instead because much software
>> using Python does not support 3.x yet.

>
> http://www.python.org/dev/peps/pep-0397/
>
> Unix-based OSes should already obey the shebang line, and on Windows,
> there's py.exe in 3.3 that will launch the intended version based on
> that shebang line.


The problem with that is that one has to already being using 3.3 to use
this facility. I was hoping for a solution which was backwards
compatible with Python 2.x.

My thought is a program distributed by Python which finds the versions
of Python on an OS, lets the end-user choose which version should be
invoked when Python is invoked, and does whatever is necessary to make
that version the default version.

> While I was using the alpha/beta versions of 3.3, I
> had no problems invoking either 3.2 or 3.3 with the shebang line on Windows.


That does not solve the problem for Python 2.x distributions.

 
Reply With Quote
 
Andrew Berg
Guest
Posts: n/a
 
      10-01-2012
On 2012.09.30 22:06, Edward Diener wrote:
> The problem with that is that one has to already being using 3.3 to use
> this facility. I was hoping for a solution which was backwards
> compatible with Python 2.x.

It's a separate tool that comes with 3.3. You can install 3.3 and never
use the actual 3.3 interpreter if you wish.

> That does not solve the problem for Python 2.x distributions.

Compatibility across versions of Python is irrelevant; the launcher
doesn't execute any Python code itself.
Straight from the PEP:
> The launcher is not tied to a specific version of Python - eg., a
> launcher distributed with Python 3.3 should be capable of locating and
> executing any Python 2.x and Python 3.x version.


--
CPython 3.3.0 | Windows NT 6.1.7601.17835
 
Reply With Quote
 
Dave Angel
Guest
Posts: n/a
 
      10-01-2012
On 09/30/2012 11:06 PM, Edward Diener wrote:
> On 9/30/2012 3:38 PM, Andrew Berg wrote:
>> On 2012.09.30 14:14, Edward Diener wrote:
>>> The situation is so confusing on Windows, where the file associations,
>>> registry entries, and other internal software which allows a given
>>> Python release to work properly when invoking Python is so complicated,
>>> that I have given up on trying to install more than one Python release
>>> and finding a relaible, foolproof way of switching between them. So
>>> although I would like to use the latest 3.x series on Windows I have
>>> decide to stick with the latest 2.x series instead because much
>>> software
>>> using Python does not support 3.x yet.

>>
>> http://www.python.org/dev/peps/pep-0397/
>>
>> Unix-based OSes should already obey the shebang line, and on Windows,
>> there's py.exe in 3.3 that will launch the intended version based on
>> that shebang line.

>
> The problem with that is that one has to already being using 3.3 to
> use this facility. I was hoping for a solution which was backwards
> compatible with Python 2.x.
>
> My thought is a program distributed by Python which finds the versions
> of Python on an OS, lets the end-user choose which version should be
> invoked when Python is invoked, and does whatever is necessary to make
> that version the default version.
>
>> While I was using the alpha/beta versions of 3.3, I
>> had no problems invoking either 3.2 or 3.3 with the shebang line on
>> Windows.

>
> That does not solve the problem for Python 2.x distributions.
>


If you read the Pep, it says the launcher will work for both 2.x and 3.x
http://www.python.org/dev/peps/pep-0397/
<http://www.python.org/dev/peps/pep-0397/>

I've read that elsewhere, but I can't see just where you would get the
necessary modules to run it with 2.x Possibly you'd have to build it
from sources, as there are Windows binaries that get installed to the
C:\Windows directory.

--

DaveA

 
Reply With Quote
 
Mark Lawrence
Guest
Posts: n/a
 
      10-01-2012
On 01/10/2012 04:06, Edward Diener wrote:
> On 9/30/2012 3:38 PM, Andrew Berg wrote:
>> Unix-based OSes should already obey the shebang line, and on Windows,
>> there's py.exe in 3.3 that will launch the intended version based on
>> that shebang line.

>
> The problem with that is that one has to already being using 3.3 to use
> this facility. I was hoping for a solution which was backwards
> compatible with Python 2.x.
>


You don't need 3.3 to get py.exe. I've been running it for months, it's
available here https://bitbucket.org/vinay.sajip/pylauncher/downloads

--
Cheers.

Mark Lawrence.

 
Reply With Quote
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      10-01-2012
On Sun, 30 Sep 2012 23:06:04 -0400, Edward Diener
<> declaimed the following in
gmane.comp.python.general:


> My thought is a program distributed by Python which finds the versions
> of Python on an OS, lets the end-user choose which version should be
> invoked when Python is invoked, and does whatever is necessary to make
> that version the default version.
>

Which wouldn't be usable on any system that has to boot/process
unattended, and run's Python scripts for configuration set-up.

Making a version "default" pretty much means being able to rewrite
the PATH environment variable... And I've seen too many messes made by
some software already (including once having two generations of Python
showing up in one PATH!)

--
Wulfraed Dennis Lee Bieber AF6VN
HTTP://wlfraed.home.netcom.com/

 
Reply With Quote
 
David Robinow
Guest
Posts: n/a
 
      10-01-2012
On Sun, Sep 30, 2012 at 11:55 PM, Dave Angel <> wrote:
>> The problem with that is that one has to already being using 3.3 to
>> use this facility. I was hoping for a solution which was backwards
>> compatible with Python 2.x.
>>...
>> That does not solve the problem for Python 2.x distributions.

> If you read the Pep, it says the launcher will work for both 2.x and 3.x
> http://www.python.org/dev/peps/pep-0397/
> <http://www.python.org/dev/peps/pep-0397/>
>
> I've read that elsewhere, but I can't see just where you would get the
> necessary modules to run it with 2.x Possibly you'd have to build it
> from sources, as there are Windows binaries that get installed to the
> C:\Windows directory.

I'm not sure what you're getting at here. The solution is to install
Python 3.3, which provides the launcher. It works with Python 2.x. Is
there some reason not to install 3.3?
 
Reply With Quote
 
Mark Lawrence
Guest
Posts: n/a
 
      10-01-2012
On 01/10/2012 20:36, David Robinow wrote:
> On Sun, Sep 30, 2012 at 11:55 PM, Dave Angel <> wrote:
>>> The problem with that is that one has to already being using 3.3 to
>>> use this facility. I was hoping for a solution which was backwards
>>> compatible with Python 2.x.
>>> ...
>>> That does not solve the problem for Python 2.x distributions.

>> If you read the Pep, it says the launcher will work for both 2.x and 3.x
>> http://www.python.org/dev/peps/pep-0397/
>> <http://www.python.org/dev/peps/pep-0397/>
>>
>> I've read that elsewhere, but I can't see just where you would get the
>> necessary modules to run it with 2.x Possibly you'd have to build it
>> from sources, as there are Windows binaries that get installed to the
>> C:\Windows directory.

> I'm not sure what you're getting at here. The solution is to install
> Python 3.3, which provides the launcher. It works with Python 2.x. Is
> there some reason not to install 3.3?
>


Fo those who missed it earlier you can download the launcher here
https://bitbucket.org/vinay.sajip/pylauncher/downloads , you don't need
Python 3.3.

--
Cheers.

Mark Lawrence.

 
Reply With Quote
 
Edward Diener
Guest
Posts: n/a
 
      10-05-2012
On 10/1/2012 1:32 PM, Dennis Lee Bieber wrote:
> On Sun, 30 Sep 2012 23:06:04 -0400, Edward Diener
> <> declaimed the following in
> gmane.comp.python.general:
>
>
>> My thought is a program distributed by Python which finds the versions
>> of Python on an OS, lets the end-user choose which version should be
>> invoked when Python is invoked, and does whatever is necessary to make
>> that version the default version.
>>

> Which wouldn't be usable on any system that has to boot/process
> unattended, and run's Python scripts for configuration set-up.


I can understand that but my use of Python on Windows is not that case.
I simply want to be able to choose which version of Python runs when it
is invoked, when I have multiple versions installed. Surely that is a
very common case for end-users running 'python' or invoking some script
which is associated with python.

>
> Making a version "default" pretty much means being able to rewrite
> the PATH environment variable... And I've seen too many messes made by
> some software already (including once having two generations of Python
> showing up in one PATH!)


The PATH environment is constantly changing whether in Linux or Windows.
Claiming that this is too dangerous" is silly.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Winforms and MVC coexistence Max2006 ASP .Net 4 04-09-2009 01:43 AM
ASP ASP.NET Coexistence neerajb@noida.nospamhcltech.com ASP .Net 1 07-26-2008 02:50 AM
Visual Studio 2003 and 2005 coexistence. =?Utf-8?B?S2V2aW4gQnVydG9u?= ASP .Net 1 09-04-2006 10:48 PM
The Future of Linux's Coexistence with Windows at XYZ Computing Silverstrand Front Page News 0 04-29-2006 02:12 AM
Debian: coexistence of debs and gems? Michael Schuerig Ruby 4 05-05-2005 06:29 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57