[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: multiple versions of python



> ....
> 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 ....


-- 
Stanley C. Kitching
Human Being
Phoenix, Arizona


Reply to: