老系统Ubuntu16.04
执行pip3 install requests命令提示:DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.9.1)
声明:Python 3.5的使用寿命已于2020年9月13日到期。请升级您的Python,因为不再维护Python 3.5。 pip 21.0将于2021年1月删除对Python 3.5的支持。pip 21.0将删除对此功能的支持
Ubuntu中安装模块后发现python3.5.2已经不行了,要升级才能用某些模块了,就直接安装最新的版本吧。查了挺多资料,可能我环境有问题重装了很多次,终于找到成功的方法了。(有可能按照步骤做还是会出错)
1. 在终端中下载Python安装包:
2. 解压Python安装包
tar xzvf Python-3.9.4.tgz
3.进入python3.9
4.在./configure之前设置字符集
export LC_ALL=zh_CN.UTF-8
5.编译文件 时间大概有1-3分钟
./configure --prefix=/usr/local/python3
6.编译好后,会有另外一个提示,让If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations。
./configure --enable-optimizations
7..安装
8.新命令使用指定python运行pip
python3.9 -m pip install requests
|