LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-17-2011, 01:37 PM   #1
mad_penguin
Member
 
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:
http://wiki.linux.duke.edu/YumFaq

Any thoughts ?

BTW, any fixes I found on LQ failed! ( Please help!
 
Old 11-17-2011, 02:54 PM   #2
lithos
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 ?
Code:
yum ..... ?
or what ?

maybe
Code:
yum clean all

yum repolist all
will make a difference ?

What is your "ls /etc/yum.repos.d/"
Code:
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"
Code:
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

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
or
- what you do
to get this "error"
Quote:
'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 02:56 PM.
 
Old 11-17-2011, 05:36 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
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:	103
Size:	7.0 KB
ID:	8405  
 
  


Reply



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 08:40 AM
Broken YUM and Possibly Python nikunjbadjatya Linux - Software 3 06-17-2010 12:55 AM
Problems with Python, CentOS and Yum Hamidof Linux - Software 1 04-03-2009 01:22 PM
Broken Yum while updating centos from 4.6 to 5.2 hoodedmanwithsythe Linux - Software 2 09-20-2008 02:59 AM
Yum broken Incorrect python version FC6 zeromaster Fedora 7 11-24-2007 08:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:59 PM.

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