Maintaining Multiple Copies of Python (Linux)

N

nfitzkee

Hi all,

For various reasons, I would like to maintain multiple copies of python on my (Ubuntu 12.04) linux system. This is primarily for scientific software development; several modules require different configuration options than are installed on the 'vanilla' python included in the Ubuntu distribution, and I don't want to disturb that version in case something would interfere with the OS.

I can compile python 2.7 and put it in /usr/local, but when I do that it can lead to confusion about what version is being run, particularly if my group members don't have their paths set correctly. Renaming the binaries alone is a partial solution, but that won't work for the library and include directories.

Is there a way to configure the distribution at compile time to resolve theambiguity? For example, could I specify an option to "configure" that appends a prefix to all of the created python binaries, etc.? In this case, it might create "my-python2.7" "my-python" and "my-idle" (etc.) in /usr/local/bin, along with storing libraries in /usr/local/lib/my-python2.7/. Thus,the my-python programs would be 100% independent from the OS python, and they would be independent from other local builds as well.

I apologize if this answer is covered elsewhere; so far my google searches have not turned up anything.

Thanks,
Nick
 
N

Nicholas Fitzkee

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 thatyou 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?

Thanks again,
Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top