跳转至内容
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 发布者 421 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 我是小马甲~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 - 热门主题
    • 类似notion的笔记软件:superthread,送终身PRO会员
      M
      mooncn
      2
      7
      558

    • 联通卡免费领500G云盘定向流量(速冲)
      A
      abcpython
      2
      3
      249

    • 利用 PayPal 白嫖12个月Perplexity Pro 订阅
      undefined
      2
      1
      167

    • CodeBuddy 国际站内测邀请码 100%获取(数量有限,无有效期限制)
      L
      LeagueJinx
      1
      7
      350

    • 论坛发帖是不是该审核一下?
      youhunY
      youhun
      1
      5
      99

    • CodeBuddy 国际版邀请码分享!
      我是小马甲~M
      我是小马甲~
      1
      5
      53

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    百度网盘
    2,069 个主题
    连续剧
    873 个主题
    夸克网盘
    849 个主题
    国产剧
    659 个主题
    美剧
    408 个主题
    中国移动
    307 个主题
    动画片
    287 个主题
    动作片
    242 个主题

    188

    在线

    41.9k

    用户

    41.9k

    主题

    112.8k

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