realine not found error

D

David Bear

I built python 2.4.2 for suse linux 9.3. I configured it to be a separate
instance of python from the version packaged with suse.

Now when I start it I get an error:
python
Python 2.4.2 (#4, Jul 27 2006, 14:34:30)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 7, in ?
import readline
ImportError: No module named readline

however, I do have readline installed:

rpm -qa | grep readline
readline-5.0-7.2
readline-32bit-9.3-7.1

it id truly does exist:

locate readline
....
/lib/libreadline.so.5
/lib/libreadline.so.5.0
/lib64/libreadline.so.5
/lib64/libreadline.so.5.0
....

I googled about for this and there were numerous hits on this problem from
others, but I never found a 'solution'.
 
R

Robert Kern

David said:
I built python 2.4.2 for suse linux 9.3. I configured it to be a separate
instance of python from the version packaged with suse.

Now when I start it I get an error:
python
Python 2.4.2 (#4, Jul 27 2006, 14:34:30)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 7, in ?
import readline
ImportError: No module named readline

however, I do have readline installed:

rpm -qa | grep readline
readline-5.0-7.2
readline-32bit-9.3-7.1

it id truly does exist:

locate readline
...
/lib/libreadline.so.5
/lib/libreadline.so.5.0
/lib64/libreadline.so.5
/lib64/libreadline.so.5.0

However, these are not the Python readline module. The Suse package for it is
probably called python-readline or something like that.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 
D

David Bear

Robert said:
David said:
I built python 2.4.2 for suse linux 9.3. I configured it to be a separate
instance of python from the version packaged with suse.

Now when I start it I get an error:
python
Python 2.4.2 (#4, Jul 27 2006, 14:34:30)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 7, in ?
import readline
ImportError: No module named readline

however, I do have readline installed:

rpm -qa | grep readline
readline-5.0-7.2
readline-32bit-9.3-7.1

it id truly does exist:

locate readline
...
/lib/libreadline.so.5
/lib/libreadline.so.5.0
/lib64/libreadline.so.5
/lib64/libreadline.so.5.0

However, these are not the Python readline module. The Suse package for it
is probably called python-readline or something like that.
okay. Since I grabbed the python tar file from python.org, do I then assume
that readline is not included in the python source distribution? if so,
where would I find it. If not, what different build instructions do I need
to follow to make it build with readline?
 
R

Robert Kern

David said:
okay. Since I grabbed the python tar file from python.org, do I then assume
that readline is not included in the python source distribution? if so,
where would I find it. If not, what different build instructions do I need
to follow to make it build with readline?

Oops. Sorry, I missed that part of what you said. Use

$ ./configure --enable-readline

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
 
P

Peter Otten

David said:
I built python 2.4.2 for suse linux 9.3. I configured it to be a separate
instance of python from the version packaged with suse.

Now when I start it I get an error:
python
Python 2.4.2 (#4, Jul 27 2006, 14:34:30)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 7, in ?
import readline
ImportError: No module named readline

however, I do have readline installed:

rpm -qa | grep readline
readline-5.0-7.2
readline-32bit-9.3-7.1

You may have to install the readline-devel package and the rebuild Python.

Peter
 

ms2

Joined
Jun 29, 2007
Messages
1
Reaction score
0
late reply.

In fact, more for my own records in case I get this again. I had the same problem with SUSE10.2. I had installed Python2.5 using YAST along with Numpy, Scipy, IPython and some other packages. I'd also attempted to install these packages without YAST (probably causing the error in the first place).

Turns out, all these packages were being installed to '/usr/lib/python2.5/site-packages'.

Inspection of the path Python was using via

>>> import sys
>>> sys.path

showed python was using /usr/local/lib/python2.5/site-packages

The path was modified by editing the 'site.py' file, to include the following in the main() routine, just below the 'abs__file__()' line.


# Add new paths to the python search path, derived
# from those in sys.path. Current entries contain
# '\local\'. They should not. Added 29/June/07, MS
a = sys.path
for i in a:
if '/local/' in i:
sys.path.append(i.replace('/local',''))

This updates the path with entries not including the '/local' entry. This fixed my Scipy and my readline error on startup.

Mark.
 

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,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top