Results 1 to 9 of 9
Hello,
I know this problem is described on the internet but all the suggestions don't work for me.
When I run any yum command I get:
There was a problem ...
- 01-05-2012 #1Just Joined!
- Join Date
- Jan 2012
- Posts
- 12
yum problem
Hello,
I know this problem is described on the internet but all the suggestions don't work for me.
When I run any yum command I get:
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.6.5 (r265:79063, Feb 28 2011, 21:55:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]
If you cannot solve this problem yourself, please go to
the yum faq at:
When I runi get "Python 2.6.5"Code:python -V
I guess it should be 2.4.x but I do not know how to downgrade it.
I can't find appropriate rpm.
Any suggestions please?
Regards, Tom
- 01-05-2012 #2
Hello and welcome
Can you post the output of
I fear that yum has been removed which can be a very difficult thing to fix sometimes.Code:yum clean all
I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
- 01-05-2012 #3Just Joined!
- Join Date
- Jan 2012
- Posts
- 12
Hi,
Any yum command gives:
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.6.5 (r265:79063, Feb 28 2011, 21:55:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]
If you cannot solve this problem yourself, please go to
the yum faq at: ...
So it looks that yum is not working with python 2.6.5.
I have changed symbolic link for python:
thenCode:rm /usr/bin/python ln -s /usr/bin/python /usr/bin/python
gives Python 2.4.3 and yum worksCode:python -V
Tom
- 01-05-2012 #4Just Joined!
- Join Date
- Jan 2012
- Posts
- 12
Does anybody know what version of yum works with Python 2.6.5.
Currently I have yum 3.2.22
Regards, Tom
- 01-05-2012 #5
Hmm, interesting and I'm glad you got it working for now but why did this happen? Is this an upgrade from an existing system? Did you make some changes to the system that caused this? Also, how did you know to remove the symbolic link to make yum work? Was that in the link from the above error? These answers will surely help someone else with similar problems. Thanks for taking the time to post your solution.
I think your best bet right now would be to do a complete system (yum -y update) update before you go any further.I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
- 01-06-2012 #6Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
I'm guessing what happened is that you tried to update python, but the installed yum module is only located in the lib area of the version of python installed with the OS (/usr/lib/python2.4), and not where the new version of python expects to find it (/usr/lib/python2.6).
You might be able to get a newer version of yum to work with your existing configuration (be it python2.4, 2.6, or whatever) by compiling it from source (located here). The yum developers actually encourage you to make an RPM from the source - which is the same thing as compiling it for your machine, but then packaging it as an RPM, which is nice. The source tarball includes the spec file (yum.spec) that you will need. With the latest version of the source tarball on their website, I found that I had to change the Version tag in it from 3.4.2 to 3.4.3, though. I have done this before when I really needed a newer version of Yum on an older system.
To do it, you'll need to setup up your RPM build environment, which is pretty easy. You just need to:
1. install the rpm build tools (as root):
2. prepare your RPM build environment (as regular user), e.g.:Code:yum install rpm-build
3. create your users's rpmbuild rc file (~/.rpmmacros), e.g.:Code:mkdir -p ~/rpms/BUILD ~/rpms/RPMS ~/rpms/SOURCES ~/rpms/SPECS ~/rpms/SRPMS
Code:# adds Packager info to RPM %packager Your Name # disables automatic creation of -debuginfo RPM %debug_package %{nil} # short-hand distribution name (e.g. RHEL 5) %dist .el5 # set toplevel for all rpm subdirs (e.g., system _topdir is /usr/src/redhat) %_topdir %(echo $HOME/rpms)
Once you have your build environ ready, copy the yum source tarball to your SOURCES dir (e.g. cp yum-3.4.3.tar.gz ~/rpms/SOURCES/), then do:
If successful, it will put the finished yum RPM files in the ~/rpms/RPMS/noarch/ directory. You can then try an upgrade of yum with:Code:rpmbuild -bb yum.spec
If you hit dependency errors here, you can:Code:yum localinstall ~/rpms/RPMS/noarch/yum-3.4.3-0.noarch.rpm
- uninstall those packages, if you don't need them
- try to upgrade those packages, too
- force the install of the newer yum version by ignoring dependencies (this idea is pretty crazy)
- back off and decide your yum is good enough.
- 01-06-2012 #7Just Joined!
- Join Date
- Jan 2012
- Posts
- 12
Hello,
I was moving files for website from old to new server. Website is made in Django and I was told by developer that I have to have Python 2.6.2+.
Developer installed Python 2.6.5 but as you know the problem was that yum stopped working.
I have founded on another forum that somebody wrote something about symbolic link and it worked.
I knew that this is issue with Python 2.6.5 from the error and from different forums.
Regards, Tom
- 01-06-2012 #8Just Joined!
- Join Date
- Jan 2012
- Posts
- 12
Hi,
atreyu thanks for your input.
I will try your suggestion.
I have read somewhere that I should try change in yum config file default path to python. Because in my case when Python 2.6.5 is installed yum wants to use it as default.
So I guess I should be able to tell yum to use /usr/lib/python2.4 but in config file for yum I did not find anything...
Do you or anybody think it is possible?
Regards
- 01-06-2012 #9Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Take a look at this thread:
How To Install Python 2.6 On CentOS 5 Without Breaking Yum
I am assuming you are on CentOS/RHEL 5.x.
I verified that the repo listed there does in fact exist - it is here:
Index of /centos/5/i386/
maybe it will work for you.


Reply With Quote
