Migrating from Python2.4 to Python2.6 on CentOS. Module migration problem

Hi guys, I have a problem updating python from 2.4 to 2.6:

I have CentOS 5 (full)
It has python 2.4 living in / usr / lib / python 2.4 /
Additional modules are in / usr / lib / python 2.4 / site-packages /

I built python 2.6 from sources on / usr / local / lib / python 2.6 / I set python by default for python2.6
Now the old modules for 2.4 come out of pythonpath and are "lost",
In particular, yum is broken ("there is no module with the name yum ")

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

+3
source share
4 answers

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

Yes, Python during installation will replace the python command with the installed version (if you did not run it with -alt-install). You haven’t indicated exactly what your problem is, so I’m going to guess. Your problem is that many local commands using Python now fail because they run with Python 2.6 and not Python 2.4. It is right?

, /usr/local/bin/python , /usr/bin/python /usr/bin/python 2.4. python2.6 python2,6, . . 2.6.

, 2.6, . , setuptools. easy_install script,

easy_install <modulename>

pypi.python.org . , . easy_install , distutils , . 90% .

C-, , , , , , CentOS.

, . 2.4 2.6 , .pyc ( 100%), , , C, . Python .pyc. , , Python , .; -)

, , "", I.e. , . virtualenv buildout, python, . . .

+3

...

  • Python 2.6, 2.6 .

  • 2.6, 2.6 . , 2.6 "python setup.py"

...

serverfault.com, .

0

Python , Python 2.6 site-packages dist-packages.

- , (, make install), dist- .

0

easy_install , , :

  • -
  • "python setup.py install"

, python; :

python -V

0

Source: https://habr.com/ru/post/1711841/


All Articles