LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-05-2009, 09:58 AM   #1
fear_matrix
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Rep: Reputation: 0
Python Error is SLES (No module name readline)


Guys i have really lost my patience and now i want help from you guys . I recently installed python in SLES and now i get the below error when running it. I have googled a lot for possible solution but no luck found. Please guys help me on this


Code:
    The GCC team.
Distribution: SUSE Linux Enterprise 11
linux-ooix:~/Desktop # python3
Python 3.1.1 (r311:74480, Dec  4 2009, 23:28:49) 
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
  File "/etc/pythonstart", line 7, in <module>
    import readline
ImportError: No module named readline
Regards
fear_matrix
 
Old 12-05-2009, 12:17 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Quote:
Originally Posted by fear_matrix View Post
Code:
File "/etc/pythonstart", line 7, in <module>
    import readline
ImportError: No module named readline
Wf is /etc/pythonstart? I don't have one. What does it say on and around line 7? import readline?

Note that python 3.1 code related to readline may be found in these files:
Code:
jameson@salmon:/usr/lib/python3.1$find . -name "*readline*"
./lib2to3/fixes/fix_xreadlines.py
./lib2to3/fixes/fix_xreadlines.pyc
./lib-dynload/readline.so
What do you see when you perform that find in your python dir?
 
Old 12-06-2009, 01:14 AM   #3
fear_matrix
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jhwilliams View Post
Wf is /etc/pythonstart? I don't have one. What does it say on and around line 7? import readline?

Note that python 3.1 code related to readline may be found in these files:
Code:
jameson@salmon:/usr/lib/python3.1$find . -name "*readline*"
./lib2to3/fixes/fix_xreadlines.py
./lib2to3/fixes/fix_xreadlines.pyc
./lib-dynload/readline.so
What do you see when you perform that find in your python dir?

Well in line 7 it says Import Readline. Funny thing is that it works perfectly in Red Hat Linux Enterprise 5. This is really getting into my nerve
 
Old 12-06-2009, 04:43 AM   #4
km0r3
LQ Newbie
 
Registered: Oct 2009
Distribution: Ubuntu, SME, Arch
Posts: 11

Rep: Reputation: 1
Hi,

1) Temporarily add this line to your $HOME/.bashrc or $HOME/.profile:

Quote:
PYTHONPATH=$PYTHONPATH=/usr/lib/python3.1/lib-dynload/
export $PYTHONPATH
reset your shell and try to invoke python3.1

OR

2) Try to install first readline development headers (in Ubuntu called readline-dev; no idea how this is called, neither installed, in Suse) and then compiling Python 3.1 from source. [http://python.org]
This usually helps.


Hope this helps.
 
Old 12-07-2009, 03:17 AM   #5
fear_matrix
LQ Newbie
 
Registered: Dec 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by km0r3 View Post
Hi,

1) Temporarily add this line to your $HOME/.bashrc or $HOME/.profile:



reset your shell and try to invoke python3.1

OR

2) Try to install first readline development headers (in Ubuntu called readline-dev; no idea how this is called, neither installed, in Suse) and then compiling Python 3.1 from source. [http://python.org]
This usually helps.


Hope this helps.

Thanks for your help but the above solution did not resolved my issue. It seems that the readline module was missing in SLES 11 which is important for Python 3 to run stable. Anyways i have resolved this issue and i would like to share the solution with you guys :-

Solution

1 - I downloaded readline 5.2 from icewalkers website
2 - Installed readline 5.2 by compiling it from the source code
3 - Re-compiled Python 3 from the source code
4 - I executed python 3 and everything is working smoothly without any error.

Regards
Fear_Matrix
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
Python File#readline skips to end of file taylor_venable Programming 3 05-09-2008 09:32 AM
Need Help Installing gnome-python-extras on SLES 10 hucphin Linux - Software 2 07-27-2007 09:35 AM
Readline command error Jacko123 Programming 1 03-02-2007 07:51 AM
Error in basic button response program in Python 2.4 with the Tkinter module jojotx0 Programming 1 05-23-2006 07:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration