Re: multiple versions of python
Thanks, Stanley!
On 01/04/2015 10:32 AM, Stanley C. Kitching wrote:
>
>
>> ....
>> 1] Can I have multiple versions of python simultaneously?
>> ....
>
> yes
>
> Using Debian Wheezy I have 3 python versions installed
>
> # ls -1 /usr/lib | grep python | grep -v lib
>
> python
> python2.6
> python2.7
> python3
> python3.2
>
> python is python2.7
> python3 is python3.2
>
> ===========================================================
>
>> 2] Is there a way to specify that one package
>> use a non-default version of python ?
>> ....
>
> yes
>
> Use the specific python version name
> when starting your program
>
> pythonX.Y /path/to/zProgram.py
>
> For example, I have a small program
> that only prints the current python version
> that it has been started with ....
>
> $ python $p/amisc/version.py
>
> python version .... 2.7.3
>
> $ python2.6 $p/amisc/version.py
>
> python version .... 2.6.8
>
> $ python2.7 $p/amisc/version.py
>
> python version .... 2.7.3
>
> $ python3 $p/amisc/version.py
>
> python version .... 3.2.3
>
> $ python3.2 $p/amisc/version.py
>
> python version .... 3.2.3
>
>
> Using the name python is the same
> as using the name python2.7
>
> python2.7 is the default version
>
> Using the name python3 is the same
> as using the name python3.2
>
> ===========================================================
>
>> 3] Is this a quick, straightforward install ?
>> ....
>
> yes
>
> Use the Debian package manager
> to install the different python versions
>
> # sudo apt-get install python
>
> # sudo apt-get install python3
>
> If you start your python programs
> using specific python version names
> nothing else should be necessary ....
>
>
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
Reply to: