python报错:Python 2.7 will reach the end of its life on January 1st, 2020.

python报错:Python 2.7 will reach the end of its life on January 1st, 2020.

环境描述

  • centos 7

错误描述

    在使用centos7的时候,使用pip安装的时候,可能会报错:

DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.

    是由于centos7默认安装了python2.7,但是python2.7的生命周期到2020年1月1日就会结束,所以是使用不了pip进行安装的。

解决办法

    解决方法就是将python2升级为python3,推荐使用此链接的方法进行安装升级:cnblogs.com,已经测试实现过,确认解决有效。
    注意:更改之后,执行python文件时,需要把头部的代码更改如下:

# 更改前
# !/usr/bin/python

# 更改后
# !/usr/bin/python3
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值