跳转至内容
0
  • 版块
  • 讨论
  • 最新
  • 标签
  • 热门
  • 顶端
  • 用户
  • 版块
  • 讨论
  • 最新
  • 标签
  • 热门
  • 顶端
  • 用户
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Zephyr)
  • 不使用皮肤
折叠
JIKE社区
  1. 首页
  2. 讨论区
  3. 技术专区
  4. CentOS 7 python2.7.5 升级到 python 2.7.18 步骤以及问题

CentOS 7 python2.7.5 升级到 python 2.7.18 步骤以及问题

已定时 已固定 已锁定 已移动 技术专区
1 帖子 1 发布者 448 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 我是小马甲~M 在线
    我是小马甲~M 在线
    我是小马甲~
    🤫
    写于 最后由 malaohu 编辑
    #1

    python升级

    yum install gcc openssl-devel bzip2-devel 
    
    
    cd /usr/src
    wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
    
    tar xzf Python-2.7.18.tgz
    
    cd Python-2.7.18
    ./configure --enable-optimizations
    make altinstall
    
    /usr/local/bin/python2.7 -V
    
    # Python 2.7.18
    
    mv /usr/bin/python /usr/bin/python2.7.5
    
    ln -s /usr/local/bin/python2.7 /usr/bin/python
    
    

    pip安装

    wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
    python get-pip.py
    

    各种错误

    No module named yum

    更新完后,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.7.18 (default, Jul 20 2021, 22:48:22) 
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://yum.baseurl.org/wiki/Faq
    

    修改:/usr/bin/yum

    #!/usr/bin/python2.7.5
    

    No module named urlgrabber.grabber

    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Traceback (most recent call last):
      File "/usr/libexec/urlgrabber-ext-down", line 22, in <module>
        from urlgrabber.grabber import \
    ImportError: No module named urlgrabber.grabber
    

    修改:vi /usr/libexec/urlgrabber-ext-down
    同上

    唐宋元明清,连排小工兵!

    1 条回复 最后回复
    0
    回复
    • 在新帖中回复
    登录后回复
    • 从旧到新
    • 从新到旧
    • 最多赞同


    Popular Topics - 热门主题
    • 买火车票优惠
      undefined
      1
      1
      65

    • 联通app去搜 优享会员
      undefined
      1
      1
      144

    • 中国站ESA免费版重磅发布,白嫖阿里云免费ESA安全加速CDN
      L
      LeagueJinx
      0
      7
      228

    • 【邮储银行】微信立减金券包20元~
      不
      不隔山
      0
      2
      49

    • 帕萨特座椅记忆突然失灵,如何恢复?
      我是小马甲~M
      我是小马甲~
      0
      2
      19

    • 移动1元支付宝红包或8元电费券 5元话费券
      不
      不隔山
      0
      2
      191

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    百度网盘
    2,749 个主题
    夸克网盘
    1,954 个主题
    连续剧
    1,068 个主题
    国产剧
    755 个主题
    美剧
    488 个主题
    动作片
    382 个主题
    动画片
    327 个主题
    恐怖片
    316 个主题

    177

    在线

    42.8k

    用户

    43.5k

    主题

    114.8k

    帖子
    • 第一个帖子
      最后一个帖子