Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 268439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:42:03+00:00 2026-05-11T23:42:03+00:00

I have a problem of upgrading python from 2.4 to 2.6: I have CentOS

  • 0

I have a problem of upgrading python from 2.4 to 2.6:

I have CentOS 5 (Full). It has python 2.4 living in /usr/lib/python2.4/ . Additional modules are living in /usr/lib/python2.4/site-packages/ . I’ve built python 2.6 from sources at /usr/local/lib/python2.6/ . I’ve set default python to python2.6 . Now old modules for 2.4 are out of pythonpath and are "lost". In particular, yum is broken ("no module named yum").

So what is the right way to migrate/install modules to python2.6?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T23:42:03+00:00Added an answer on May 11, 2026 at 11:42 pm

    They are not broken, they are simply not installed. The solution to that is to install them under 2.6. But first we should see if you really should do that…

    Yes, Python will when installed replace the python command to the version installed (unless you run it with –alt-install). You don’t exactly state what your problem is, so I’m going to guess. Your problem is that many local commands using Python now fail, because they get executed with Python 2.6, and not with Python 2.4. Is that correct?

    If that is so, then simply delete /usr/local/bin/python, and make sure /usr/bin/python is a symbolic link to /usr/bin/python2.4. Then you would have to type python2.6 to run python2,6, but that’s OK. That’s the best way to do it. Then you only need to install the packages you need in 2.6.

    But if my guess is wrong, and you really need to install all those packages under 2.6, then don’t worry too much. First of all, install setuptools. It includes an easy_install script, and you can then install modules with

    easy_install <modulename>
    

    It will download the module from pypi.python.org and install it. And it will also install any module that is a dependency. easy_install can install any module that is using distutils as an installer, and not many don’t. This will make installing 90% of those modules a breeze.

    If the module has a C-component, it will compile it, and then you need the library headers too, and that will be more work, and all you can do there is install them the standard CentOS way.

    You shouldn’t use symbolic links between versions, because libraries are generally for a particular version. For 2.4 and 2.6 I think the .pyc files are compatible (but I’m not 100% sure), so that may work, but any module who uses C will break. And other versions of Python will have incompatible .pyc files as well. And I’m sure that if you do that, most Python people are not going to help you if you do it. 😉

    In general, I try too keep the system python “clean”, I.e. I don’t install anything there that isn’t installed with the packaging tools. Instead I use virtualenv or buildout to let every application have their own python path where it’s dependencies live. So every single project I have basically has it’s own set of libraries. It gets easier that way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 162k
  • Answers 162k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer As far as I understand, this is what you are… May 12, 2026 at 12:00 pm
  • Editorial Team
    Editorial Team added an answer <?php header("HTTP/1.1 301 Moved Permanently"); header("Location: http://othersite.ro/subscribe.php"); header("Connection: close"); exit;… May 12, 2026 at 12:00 pm
  • Editorial Team
    Editorial Team added an answer You can, but it's rather cumbersome. The best reference on… May 12, 2026 at 12:00 pm

Related Questions

I've been working on an embedded C/C++ project recently using the shell in Tornado
There’s a really cool diff class hosted by Google here: http://code.google.com/p/google-diff-match-patch/ I’ve used it
I have a big problem writing a small piece of code using JS/jQuery (don't
I'm migrating a TSQL stored procedure to PL/SQL and have encountered a problem -

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.