Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 03-02-2015, 07:33 PM   #1
LQ Newbie
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
python altinstall

On Centos6.6(Final) I want to install a newer version of python:
# wget
# tar xvzf Python-2.7.7.tgz
# cd Python-2.7.7
# ./configure
# make
# make altinstall

It installed with no errors. I added the python2.7 path to PYTHONPATH and PATH. When I run the new version:

[Python-2.7.7]$ python2.7
Python 2.7.7 (default, Mar 2 2015, 16:59:59)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/home/acameron/.pystartup", line 13, in <module>
import readline
ImportError: No module named readline

Do I need additional path information? What about the site-packages?

Old 03-03-2015, 09:41 AM   #2
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
The error is generated by 'import readline' line in file '/home/acameron/.pystartup' python startup file. Please try renaming that file to something else temporarily.

Then try running the python2.7.

You have to figure out to remedy the problem.

The error means python can't locate the module readline provided by readline command line editing package.

While building python try running ./configure --help to see if there is an option for --with-readline and if present rebuild with that option.
Old 03-03-2015, 12:13 PM   #3
LQ Newbie
Registered: Feb 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled

Moving the file simply generates an error at python2.7 startup

Could not open PYTHONSTARTUP
IOError: [Errno 2] No such file or directory: '/home/acameron/.pystartup'

The python2.7 starts OK even with the error. If I remove PYTHONSTARTUP from the environment variable list, I will have no python history function. Also the other version of python (python2.6) starts without the error.

Old 03-03-2015, 06:25 PM   #4
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,612

Rep: Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649
have you ran
make distclean

---- then -----
./configure --prefix=/opt/Python27
make install
then linking the programs that NEED the newer python to that one

yum REQUIRES!!!!!!!! the default version of python
it MUST be set as the DEFAULT!!!!


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 altinstall jyunker Linux - Newbie 6 12-06-2013 12:34 PM
LXer: Python wins trademark dispute, rival stops calling itself “Python” LXer Syndicated Linux News 0 03-21-2013 07:40 PM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
LXer: Review: Programming in Python 3: A Complete Introduction to the Python Language LXer Syndicated Linux News 0 01-26-2009 04:50 AM
Python make 'altinstall' errors natv Linux - Software 0 03-08-2007 09:24 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:52 AM.

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