Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-17-2011, 02:37 PM   #1
Registered: Mar 2008
Posts: 69

Rep: Reputation: 15
centos broken yum after installing new python

Hi gents

I'm smashing my head up the wall for a couple of hours now. I have never had a issue which I couldn't resolve on my own yet, but this apparently simple issue is driving me crazy.

So, on a Centos5.7 I've which had python2.4 I've installed also python2.5. Unfortunately I have broke yum and I can fin any solution to repair it.

I have downloaded the rpm and installed once more, they install fine without errors but when running yum, I get:

'import site' failed; use -v for traceback
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.4.3 (#1, Sep 21 2011, 19:55:41)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)]

If you cannot solve this problem yourself, please go to
the yum faq at:

Any thoughts ?

BTW, any fixes I found on LQ failed! ( Please help!
Old 11-17-2011, 03:54 PM   #2
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
what command do you type ?
yum ..... ?
or what ?

yum clean all

yum repolist all
will make a difference ?

What is your "ls /etc/yum.repos.d/"
drwxr-xr-x  2 root root  4096 Apr  9  2011 ./
drwxr-xr-x 95 root root 12288 Nov 16 09:49 ../
-rw-r--r--  1 root root  1333 Apr  9  2011 atomic.repo
-rw-r--r--  1 root root  2049 Jun 19  2008 CentOS-Base.repo
-rw-r--r--  1 root root   626 Jun 19  2008 CentOS-Media.repo
-rw-r--r--  1 root root   710 Apr 17  2007 CentOS-Testing.repo
-rw-r--r--  1 root root   954 Apr  9  2011 epel.repo
-rw-r--r--  1 root root  1054 Apr 25  2008 epel-testing.repo
-rw-r--r--  1 root root   684 Mar  8  2007 mirrors-rpmforge
-rw-r--r--  1 root root   529 May 17  2010 remi.repo
-rw-r--r--  1 root root   428 Mar  8  2007 rpmforge.repo
or "cat /etc/yum.conf"

# Note: yum-RHN-plugin doesn't honor this.

installonly_limit = 5

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
You don't provide any information of
- what you type
- what you do
to get this "error"
'import site' failed; use -v for traceback
and use [code] tags around text to make readable what is your output or command lines you type.

Last edited by lithos; 11-17-2011 at 03:56 PM.
Old 11-17-2011, 06:36 PM   #3
Registered: May 2001
Posts: 29,394
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Originally Posted by mad_penguin View Post
on a Centos5.7 I've which had python2.4 I've installed also python2.5.
Centos depends on Python for system ops and uses specific software versions to ensure stability, longevity and integrity. As far as I know Red Hat nor Centos provide official documentation or HOWTO's on how to upgrade from Python-2.4 to Python-2.5. Your valuable lesson for today is that fscking with Python, RPM and their dependencies means jeopardizing the system. Remove all remnants of Python-2.5 packages and dependencies then install the packages listed in the attached screen shot via rpm. The list is from a lean and mean Centos-5.7 installation and only lists the core Python, RPM and Yum packages and depdendencies.
Attached Thumbnails
Click image for larger version

Name:	centos-5.7-minimal_Python_RPM_Yum.png
Views:	64
Size:	7.0 KB
ID:	8405  


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
[SOLVED] Installing package(s) with command yum -y install python-libs .. Jan-Ivar Linux - Newbie 6 07-21-2011 09:40 AM
Broken YUM and Possibly Python nikunjbadjatya Linux - Software 3 06-17-2010 01:55 AM
Problems with Python, CentOS and Yum Hamidof Linux - Software 1 04-03-2009 02:22 PM
Broken Yum while updating centos from 4.6 to 5.2 hoodedmanwithsythe Linux - Software 2 09-20-2008 03:59 AM
Yum broken Incorrect python version FC6 zeromaster Fedora 7 11-24-2007 09:54 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:04 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration