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

Re: Using two versions of Python



Andreas Rippl wrote:

On Fri, Feb 04, 2005 at 08:54:47PM -0500, Edward C. Jones wrote:
I have the package "python2.3_2.3.4+2.3.5c1-1_i386.deb" on my Debian sid system. I also compiled the Python tarball. It is in "/usr/local". I would like all of the code that I have written to use Python 2.4 without messing up all the Debian packages that use 2.3. My programs all contain "#! /usr/bin/env python". I would prefer not to change them all. How can I do this?

For some reason, my PATH variable is set so that /usr/local/bin/ is
searched before /usr/bin/. While I don't have this problem with Python
(where I have all my modules compiled for 2.3 and I don't look forward to
the headache of recompiling them for 2.4) I have programs running that I
compiled myself, and in this way, the default is to run the
self-compiled version. Are there any security considerations I am
violating? Anyway, this procedure also would give you what you want...

Andreas

I tried this but I made a dumb mistake. I copied some PATH stuff from an old ".bashrc" file to my current ".bash_profile". The PATH stuff belongs in ".bashrc". Here is a useful quote from a Gentoo ".bashrc" file:

# This file is sourced by all *interactive* bash shells on startup.  This
# file *should generate no output* or it will break the scp and rcp commands.

# The file .bash_profile runs when the user logs in. The file .bashrc runs
# each time a terminal window is opened. At Terminal Window Startup Time:
# .bashrc checks to see if /etc/bashrc exists and calls it. /etc/bashrc sets
# the PATH variable, but DOES NOT include $PATH in its new PATH, causing it
# to overwrite the PATH that was originally set in the user's .bash_profile.




Reply to: