[Chicago] Best practices for installing and maintaining python for multiple versions.

Carl Karsten cfkarsten at gmail.com
Tue Dec 15 16:28:36 CET 2009


I use virtualenv for my 2.6 work with various 3rd party python
packages, like from pypi - I don't see how it will help for switching
between 2.x and 3.x - so can someone walk me though setting up
virtualenv for python 2/3?

I install ubuntu, it comes with:
Python 2.6.4 (r264:75706, Dec  8 2009, 11:51:43)

carl at gw42:~$ apt-cache policy python3.1
python3.1:
  Installed: (none)
  Candidate: 3.1.1-0ubuntu5

What next?


On Tue, Dec 15, 2009 at 9:17 AM, Jason Abate <jason at panopta.com> wrote:
> You can create multiple virtualenv installations, one per interpreter.  I do
> this regularly for different projects and build requirements, each install
> has a script that activates it, so it's just a matter of doing:
>
>   source py2.6-nltk/bin/activate
>
> or
>
>   source py2.4-tg/bin/activate
>
> to switch between environments.  Once you've run this, executing "python" or
> "easy_install" uses the executables from the virtual environment.
>
> This works great, and I use it for all of my Python projects now.  It also
> has the advantage of being able to cleanly stay up-to-date with the latest
> development of the various packages you use.  I do all my work on Debian
> which is great for stability but lags far behind the fast-moving world of
> Python.
>
> Note, I haven't jumped to 3.x yet so I'm not sure if anything's changed
> there, but I would assume something similar is possible.
>
> -jason
>
> Jason Abate
> Panopta | We see it all
> jason at panopta.com
> http://www.panopta.com
>
>
>
> Carl Karsten wrote:
>>
>> Matt,
>>
>> How would you use virtualenv to flip between python 2.x and 3.x?
>>
>> On Tue, Dec 15, 2009 at 8:57 AM, Matthew Kemp <mattkemp at gmail.com> wrote:
>>
>>>
>>> I use virtual environments (http://pypi.python.org/pypi/virtualenv)
>>> heavily.
>>> Basically they allow you to clone a python install with or without site
>>> packages. If you mess up a virtual environment just blow it away and
>>> start
>>> over.
>>>
>>> Matt
>>>
>>> On Mon, Dec 14, 2009 at 10:25 PM, Dave N <Dave_N at comcast.net> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> So I've acquired a new laptop. It's a windows 7 laptop.
>>>>
>>>> After setting up python for several personal and work machines, I've
>>>> come to conclusion that there must be a better way. I can't seem to
>>>> find it, so I thought I would turn to chipy...
>>>>
>>>> I use and experiment with the following installations, roughly in
>>>> order of importance.
>>>>
>>>> CPython 2.x (2.6)
>>>> CPython 3.x (3.1)
>>>> IronPython (2.6)
>>>> AppEngine
>>>> Jython
>>>>
>>>> I also use several add on modules and have written a few of my own. I
>>>> haven't yet figured a good way to install in a sustainable way. For
>>>> example, when 2.7 comes out, how do I migrate all of modules over to
>>>> that.
>>>>
>>>> Thanks in advance for any ideas...
>>>>
>>>> Dave
>>>> _______________________________________________
>>>> Chicago mailing list
>>>> Chicago at python.org
>>>> http://mail.python.org/mailman/listinfo/chicago
>>>>
>>>
>>> _______________________________________________
>>> Chicago mailing list
>>> Chicago at python.org
>>> http://mail.python.org/mailman/listinfo/chicago
>>>
>>>
>>>
>>
>>
>>
>>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>



-- 
Carl K


More information about the Chicago mailing list