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

Edward Diener eldiener at tropicsoft.invalid
Fri Oct 5 08:15:30 EDT 2012


On 10/1/2012 12:02 PM, Alister wrote:
> On Sun, 30 Sep 2012 15:14:17 -0400, Edward Diener wrote:
>
>> 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.
>
> on my fedora system it was a simple matter of:-
> #> yum install python3
>
> to use python 3 i specify it in my shebang line
>
> #!/usr/bun/env python3
>
> Simple
>
> Not sure about Windoze though (Although from memory the install asks
> where to install so should not be a major issue)

Windows installs of Python do not distinguish releases by Pythonx(.x) 
but just install different versions of Python in different directories. 
However one can make links to the different versions based on their 
release numbers, and that would allow a shebang line work if it was 
supported.





More information about the Python-list mailing list