Uninstall one of two Python's

T

tengounplanb

Hi,

Is it possible to remove one of two instances of Python installed on
the same machine? I have two Python-2.5.2, one in /usr/local/bin/
python2.5 and the other one in /usr/bin/python2.5. The latter has the
modules I use (kinterbasdb, psycopg, mod_python,...) and the first
don't.

I have Apache with mod_python installed as well. When Apache tries to
run a Python script, I think it's using the "wrong" python, and that's
because the /usr/local/bin path is before the /usr/bin path in the
$PATH variable.

Regards

León

Ubuntu 8.04-1
kernel: 2.26.24-1
 
D

Diez B. Roggisch

Hi,

Is it possible to remove one of two instances of Python installed on
the same machine? I have two Python-2.5.2, one in /usr/local/bin/
python2.5 and the other one in /usr/bin/python2.5. The latter has the
modules I use (kinterbasdb, psycopg, mod_python,...) and the first
don't.

I have Apache with mod_python installed as well. When Apache tries to
run a Python script, I think it's using the "wrong" python, and that's
because the /usr/local/bin path is before the /usr/bin path in the
$PATH variable.

Unless you compiled the module yourself, I doubt that. Ubuntu won't ship
with a mod_* compiled against /usr/local/python

If the module picks up the wrong python, simply removing that won't work I
fear - library loading problems will occur.

So you need to recompile the module with the desired interpreter (or
re-install from the package management)

Diez
 
M

Martin v. Löwis

I have Apache with mod_python installed as well. When Apache tries to
Unless you compiled the module yourself, I doubt that. Ubuntu won't ship
with a mod_* compiled against /usr/local/python

If the module picks up the wrong python, simply removing that won't work I
fear - library loading problems will occur.

I disagree. If ldconfig prefers /usr/local/lib over /lib:/usr/lib, and
if mod_python was compiled to link against a shared libpython, and if
both Python installations are compiled with --enable-shared, then it
might well happen that the /usr/local one overrides the one that the
Ubuntu maintainer meant to use. In that case, removing the /usr/local
installation (all of it) would indeed solve the problem; one would
have to run ldconfig after doing so.

OTOH, if mod_python was statically linked against the installation in
/usr/local, then you would be right.

Regards,
Martin
 

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

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top