Find the answer to your Linux question:
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 ...
  1. #1
    Just 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 run
    Code:
    python -V
    i get "Python 2.6.5"
    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

  2. #2
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,144
    Hello and welcome
    Can you post the output of
    Code:
    yum clean all
    I fear that yum has been removed which can be a very difficult thing to fix sometimes.
    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.

  3. #3
    Just 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:
    Code:
    rm /usr/bin/python
    ln -s /usr/bin/python /usr/bin/python
    then
    Code:
    python -V
    gives Python 2.4.3 and yum works

    Tom

  4. #4
    Just 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

  5. #5
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,144
    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.

  6. #6
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Quote Originally Posted by zibrnp View Post
    Does anybody know what version of yum works with Python 2.6.5.
    Currently I have yum 3.2.22

    Regards, Tom
    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):
    Code:
    yum install rpm-build
    2. prepare your RPM build environment (as regular user), e.g.:

    Code:
    mkdir -p ~/rpms/BUILD ~/rpms/RPMS ~/rpms/SOURCES ~/rpms/SPECS ~/rpms/SRPMS
    3. create your users's rpmbuild rc file (~/.rpmmacros), e.g.:
    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:

    Code:
    rpmbuild -bb yum.spec
    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:
    yum localinstall ~/rpms/RPMS/noarch/yum-3.4.3-0.noarch.rpm
    If you hit dependency errors here, you can:
    - 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.

  7. #7
    Just Joined!
    Join Date
    Jan 2012
    Posts
    12
    Quote Originally Posted by MikeTbob View Post
    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.
    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

  8. #8
    Just 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

  9. #9
    Linux 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...