CentOS 7中运行yum install python-dev报错

今天准备在Cent OS7中运行yum install python报如下错误:

[root@bogon ~]# yum install python-dev
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.nju.edu.cn
* updates: mirrors.nju.edu.cn
File "/usr/libexec/urlgrabber-ext-down", line 28
except OSError, e:
^
SyntaxError: invalid syntax


Exiting on user cancel

Cent OS7中安装的版本是:

[root@bogon ~]# python -V
Python 3.5.2

从网上查是因为urlgrabber-ext-down这个文件没有修改

[root@bogon ~]# vi /usr/libexec/urlgrabber-ext-down

将#! /usr/bin/python 更新为#! /usr/bin/python2.7.5(我的旧版本中是2.7.5)

#! /usr/bin/python2.7.5
# A very simple external downloader
# Copyright 2011-2012 Zdenek Pavlas

# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

保存后正常

 

转载于:https://www.cnblogs.com/liyan630912/p/7520121.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值