Broken Python 2.6 installation on Ubuntu Linux 8.04

J

John Ladasky

Hello everyone,

I've posted this same question over on ubuntuforums.org, so I'm trying
to get help in all of the logical places.

I'm running Ubuntu Linux 8.04 (Hardy) on a fairly new x86 box, with
two hard disks in a software RAID 1 configuration.

Hardy comes with Python 2.5 as a standard package, but not 2.6. I
would really like to have the "combinations" function that is included
with itertools in Python 2.6. I tried writing a combinations function
of my own, but it's SLOW and uses a HUGE amount of memory.

So, in my case the Linux Synaptic Package Manager cannot be used to
install Python 2.6. I therefore attempted a manual installation. I
downloaded the Linux tarball for Python 2.6 from python.org. I
followed the installation instructions, and they appeared to execute
fine. But when I started IDLE, I still had Python 2.5. No good.

I do most of my editing in SCIte. Apparently SCIte knows that I have
Python 2.6, and is trying to use it. Alas, my programs depend on extra
Python packages such as biopython, numpy and matplotlib. My Python 2.6
distro does not have these yet. None of my programs will run from
SCIte!

Looking down into the details of the install, I've discovered that
Hardy placed the Python 2.4 and 2.5 executables in /usr/bin. My
Python 2.6 installation ended up in /usr/local/bin. This may be
contributing to my problems.

Given the mess I've made by trying to just install plain-old Python, I
don't know whether I should attempt to back out, or to press on. Can I
convince IDLE to connect to Python 2.6? How do I manually install
site packages?

Alternately, I COULD upgrade my Ubuntu Linux to 9.4 (Jaunty) or 9.10
(Karmic). Python 2.6 comes standard with both of these. But this is
why I mentioned that my storage is RAID1. Apparently, upgrading with
RAID present is a serious headache. The Linux wizards are supposed to
be fixing these problems in the next release, due in April. I could
wait, I suppose.

In the mean time, I may have to uninstall Python 2.6 and get my 2.5
running again. I have not found any instructions for how to do that.

Help!
 
B

Benjamin Kaplan

Hello everyone,

I've posted this same question over on ubuntuforums.org, so I'm trying
to get help in all of the logical places.

I'm running Ubuntu Linux 8.04 (Hardy) on a fairly new x86 box, with
two hard disks in a software RAID 1 configuration.

Hardy comes with Python 2.5 as a standard package, but not 2.6.  I
would really like to have the "combinations" function that is included
with itertools in Python 2.6.  I tried writing a combinations function
of my own, but it's SLOW and uses a HUGE amount of memory.

So, in my case the Linux Synaptic Package Manager cannot be used to
install Python 2.6.  I therefore attempted a manual installation.  I
downloaded the Linux tarball for Python 2.6 from python.org.  I
followed the installation instructions, and they appeared to execute
fine.  But when I started IDLE, I still had Python 2.5.  No good.

How did you start IDLE? If you started it by going to the Applications
menu, it still points to the Python 2.5 idle. If you open up a
terminal and run idle, it should run Python 2.6. If it doesn't, make a
..bashrc file in your home directory and add the line
"$PATH=/usr/local/bin:$PATH".
I do most of my editing in SCIte.  Apparently SCIte knows that I have
Python 2.6, and is trying to use it. Alas, my programs depend on extra
Python packages such as biopython, numpy and matplotlib. My Python 2.6
distro does not have these yet. None of my programs will run from
SCIte!

Extensions written in C must be recompiled for every version of
Python. Since you're using a version of Python not available through
the package manager, your packages are also not available through
that. You'll have to download the sources for those and compile them
by hand to. This is why most people stick with the precompiled
binaries.
Looking down into the details of the install, I've discovered that
Hardy placed the Python 2.4 and 2.5 executables in /usr/bin.  My
Python 2.6 installation ended up in /usr/local/bin.  This may be
contributing to my problems.

It shouldn't be. /usr/local/bin should already be on your path in
front of /usr/bin. If it isn't put it there (that's what the .bashrc
file I listed before does)
Given the mess I've made by trying to just install plain-old Python, I
don't know whether I should attempt to back out, or to press on. Can I
convince IDLE to connect to Python 2.6?  How do I manually install
site packages?

Download the package sources and compile them yourself. Python
packages have a very easy way to do that- just cd into the source
folder and run "python setup.py install"
Alternately, I COULD upgrade my Ubuntu Linux to 9.4 (Jaunty) or 9.10
(Karmic).  Python 2.6 comes standard with both of these.  But this is
why I mentioned that my storage is RAID1.  Apparently, upgrading with
RAID present is a serious headache.  The Linux wizards are supposed to
be fixing these problems in the next release, due in April.  I could
wait, I suppose.

In the mean time, I may have to uninstall Python 2.6 and get my 2.5
running again.  I have not found any instructions for how to do that.

Your Python2.5 installation is just fine. You can get to it by running
python2.5 at the command line (as opposed to "python" which should run
python2.6)
 
J

John Ladasky

Thanks, Benjamin, I am getting a handle on this.

I've written my own Python modules before, and have installed them
using distutils. So I know that procedure. I just downloaded the
Numpy 1.4.0 tarball, and I succeeded in installing it. A program I
wrote which depends on numpy ran successfully from SCIte. I'll move
on to matplotlib and biopython next.

I also succeeded in running both the Python 2.6 and the Python 2.5
interpreters from the terminal prompt as you suggested.

Not sure whether I'll need to play with .bashrc yet.
 
J

John Ladasky

By the way you mustn't install your own Python with "make install", use
"make altinstall"! Your /usr/local/bin/python binary masks the original
python command in /usr/bin. You should remove all /usr/local/bin/py*
binaries that do not end with 2.6. Otherwise you may and will break
existing programs on your system.

Christian

Hello Christian,

In my earlier response to Benjamin, I thought I was going to solve
this problem quickly. Maybe not! I know for a fact that my Linux
printer management program, HPLIP toolbox, uses wxPython. And now
HPLIP won't start!

However, my usr/local/bin ONLY contains references to Python 2.6. So
I think this is a problem with me installing wx... see this other
post...


http://groups.google.com/group/comp.soft-sys.wxwindows/msg/f33e245eb0956067


Sigh. All this, just so I could use some itertools functions.
 

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
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top