解決python公升級後yum不能用的問題

2021-06-08 21:26:37 字數 759 閱讀 9814

# yum

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.4.3 (#1, oct 14 2009, 01:52:50)

[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:

直接修改 vim /usr/bin/yum

將 #!/usr/bin/python 修改為 #!/usr/bin/python2.4

上面是假設你是從2.4公升級到 2.5

其實這個時候 你可以 ls /usr/lib/python2.4/site-packages/yum

這個資料夾是否存在的

python公升級後yum無法使用

centos自帶python2.6,原始碼編譯安裝python3後,重新命名舊版本的python檔案 usr bin python為python2,再新建個軟鏈結檔案python指向新裝的python3的python執行檔案 後發現yum無法使用,提示 file usr bin yum line 3...

python公升級版本後出現的yum錯誤

在伺服器中公升級後python版本後yum源不能使用 出現 file usr bin yum line 30 except keyboardinterrupt,e syntaxerror invalid syntax 當我們輸入任何yum命令,都會報錯。原因是公升級python後,導致yum所需版本...

更新公升級python和pip版本後不生效的問題解決

寫在前面 最近在更新我伺服器上的python以及pip版本的時候,碰見了令人頭痛的問題,就是我執行了公升級指令之後,公升級也正常的successfully complete 了,但是我用python v或者pip v檢視版本的時候,發現還是原來的版本,沒有變化,解決了半天才發現問題所在,這裡就記錄一...