Help uninstalling/installing Python 2.4

B

Baggs

Guys/Gals

I've messed up my Python 2.4 install. I'm really new to Python (and
Linux for that matter) and really wanted to try Python out.

I have mandrake 10.1. The first thing I did was uninstalled via rpm
Python 2.3 and Tkinter 8.3 (I now realize that was a mistake, since I
could have both version installed with no problems). I then downloaded
Python2.4 ran ./configure make and make install... voila I had Python
installed...

Tk calls did not work, the output from Python when running a program
stated that I probably did not have TK installed. I got and installed
TK 8.4 and the problem persisted (I know I should have written down the
exact error, but I didn't... but the story gets worse!)

Here is the really stupid part... I figured if I uninstalled and
re-installed everything would be ok.... the bad part is I could not find
an uninstaller for TK or Python, so I just searched and delted the files
and directorys from /usr/local.... when I re-installed I still have
problems.. everything installs ok, but now I get the following errors
with Python...

bash: /usr/bin/python: No such file or directory

The interesting thing is the python executable is in /usr/local/bin

when I go to /usr/local/bin and type ./python I get

Python 2.4 (#6, Jan 7 2005, 18:44:57)
[GCC 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonrc.py", line 2, in ?
import readline
ImportError: No module named readline

I think some paths are screwed up.. can someone take pity on me and give
me a hand.

Thanks
Darrin

PS -- if you want to mail me directly remove the --spamreallysucks-- in
my email address.
 
C

Craig Ringer

Tk calls did not work, the output from Python when running a program
stated that I probably did not have TK installed. I got and installed
TK 8.4 and the problem persisted (I know I should have written down the
exact error, but I didn't... but the story gets worse!)

You probably didn't have the -devel packages for Tcl and Tk installed,
so Python would've decided you didn't have Tk and not built tkinter
support. Chances are if you install the devel packages and recompile
Python, it'll work fine.
when I re-installed I still have
problems.. everything installs ok, but now I get the following errors
with Python...

bash: /usr/bin/python: No such file or directory

Is that when you run a script, or when you type 'python' in your shell?
If the former, make sure you write your scripts with a #! like this:

#!/usr/bin/env python

not

#!/usr/bin/python

That way, the right python will get run so long as it's on your path -
it doesn't have to be in /usr/bin.

If the error is when typing 'python' on the command line, ensure you
have no aliases for the name 'python' hanging around ('alias python' to
find out). Also check what is actually being run with 'which python' and
see if it's a wrapper script that calls /usr/bin/python.
when I go to /usr/local/bin and type ./python I get

Python 2.4 (#6, Jan 7 2005, 18:44:57)
[GCC 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonrc.py", line 2, in ?
import readline
ImportError: No module named readline

I think some paths are screwed up.. can someone take pity on me and give
me a hand.

I'd say that'll be the same as with Tkinter - you probably didn't have
the GNU readline development headers installed, so Python disabled
readline support when it was compiled. That's just a guess, but seems
pretty likely.
 

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,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top