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.错误描述解决办法错误描述 在使用centos7的时候,使用pip安装的时候,可能会报错:DEPRECATION: Python 2.7 will reach the end of its life on Jan
·
环境描述
- 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
更多推荐
已为社区贡献2条内容
所有评论(0)