LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-25-2009, 08:35 PM   #1
von_vea
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Cool Python YUM Module not found


Good day to all!

I have CentOS 5.3 with python 2.4.3 installed by default.
Yum is working properly.

I want to use python 2.5.4. I downloaded the package
http://www.python.org/ftp/python/2.5...-2.5.4.tar.bz2

and extract it to /opt and install it using the following commands:

# ./configure && make && make install

After installing python, i type # python -V to show the version

# python -V
Python 2.4.3

What I did is move the current python in /usr/bin/

# mv -v /usr/bin/python /usr/bin/pyton243

And link it to the new one

# ln -s /usr/local/bin/python /usr/bin/python

And check the version again.

# python -V
Python 2.5.4

However, this is my problem. The YUM is no longer working.

# yum list
====
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.5.4 (r254:67916, Jul 16 2009, 03:14:54)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq

=====

I even tried to change the path located in line 1 of a yum file to the new python path. But no luck still. Any advise how do I install yum module in python or any work around for this one? Many thanks in advance.

# vi /usr/bin/yum
=====
#!/usr/local/bin/python
import sys
try:
import yum
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

%s

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:
%s

If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq

""" % (sys.exc_value, sys.version)
sys.exit(1)

sys.path.insert(0, '/usr/share/yum-cli')
try:
import yummain
yummain.user_main(sys.argv[1:], exit_code=True)
except KeyboardInterrupt, e:
print >> sys.stderr, "\n\nExiting on user cancel."
sys.exit(1)
=====

Von Vea
webmaster at vonericapparel dot com
Von Eric Apparel
 
Old 07-26-2009, 06:18 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,458

Rep: Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941Reputation: 1941
Hi and welcome to LQ!

As stated in the yum FAQ, maybe you have to rebuild the yum package to make it aware of the changes in python, then force a re-install. Take a look at this thread with some other useful hints about this topic.
 
Old 07-28-2009, 08:42 PM   #3
von_vea
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colucix View Post
Hi and welcome to LQ!

As stated in the yum FAQ, maybe you have to rebuild the yum package to make it aware of the changes in python, then force a re-install. Take a look at this thread with some other useful hints about this topic.
Thanks for your reply. However, I am using CentOS 5.3 and tried rebuilding YUM package but it doesn't help.

Any Idea ? or do i need to let my older python 2.4.3 take care for my yum. and use the new python 2.5.4 for building applications.

I believe python 2.4.3 has been installed automatically together with YUM module even no packages was selected prior to CentOS installation.

I can't figure out how the YUM has been installed as one of the python module.

Thanks again.
- Von VEA
 
  


Reply

Tags
module, python, yum


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
yum on redhat 5.3 not work python module problem cormanstnl Red Hat 1 04-10-2009 09:26 AM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
BloGTK doesn't work - python gtkhtml2 module not found vharishankar Debian 2 11-21-2006 09:29 PM
Kernel module programming Error : module not found coolguy_iiit Programming 1 07-30-2006 07:23 AM
fglrx module not found but X runs using module biger problem though HELP! fireicer Linux - Newbie 4 07-30-2004 04:44 PM


All times are GMT -5. The time now is 11:01 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration