realine not found error

Discussion in 'Python' started by David Bear, Aug 1, 2006.

  1. David Bear

    David Bear Guest

    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'.
     
    David Bear, Aug 1, 2006
    #1
    1. Advertisements

  2. David Bear

    Robert Kern Guest

    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
     
    Robert Kern, Aug 1, 2006
    #2
    1. Advertisements

  3. David Bear

    David Bear Guest

    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?
     
    David Bear, Aug 1, 2006
    #3
  4. David Bear

    Robert Kern Guest

    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
     
    Robert Kern, Aug 1, 2006
    #4
  5. David Bear

    Peter Otten Guest

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

    Peter
     
    Peter Otten, Aug 1, 2006
    #5
  6. David Bear

    ms2

    Joined:
    Jun 29, 2007
    Messages:
    1
    Likes Received:
    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.
     
    ms2, Jun 29, 2007
    #6
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.