Maintaining Multiple Copies of Python (Linux)

Oscar Benjamin oscar.j.benjamin at gmail.com
Thu May 31 05:45:39 EDT 2012


On 31 May 2012 02:41, Nicholas Fitzkee <nfitzkee at gmail.com> wrote:

> On Wednesday, May 30, 2012 7:55:33 PM UTC-5, Ben Finney wrote:
>
> > The consensus solution for this is ‘virtualenv’
> > <URL:http://pypi.python.org/pypi/virtualenv>.
> >
> > It is so popular as a solution for the kinds of problems you describe
> > that its functionality will come into core Python, as discussed in PEP
> > 405 <URL:http://www.python.org/dev/peps/pep-0405/>, for Python 3.3.
> >
> > Until you start using Python 3.3, you can install ‘virtualenv’ as a
> > third-party package.
>
> Thanks, Ben.
>
> I took a look at this, and I'm a little confused.  First, it doesn't seem
> all that different from "./configure --prefix=ENV" with the exception that
> you save a little space re-using some libraries.  Second, it really doesn't
> solve my problem, because if ENV/bin/python is my PATH, it can still be
> confused with /usr/bin/python.  What am I missing?
>

Don't place it on your PATH. I would just use the explicit path of the
virtualenv binary so that I knew which one I was running. If you want to
access it from a name such as my-python2.7 on PATH then create a symlink
pointing to the virtualenv binary. Make sure the symlink is on your path
i.e. in somewhere like /usr/bin if it is needed for all users or just ~\bin
if it only needed for 1 user.

e.g.:
$ ln -s ENV/bin/python ~/bin/my-python2.7


>
> Thanks again,
> Nick
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120531/e12f01e8/attachment.html>


More information about the Python-list mailing list