Ubuntu环境下解决‘ pip is being invoked by an old script wrapper. ...‘问题
2021/10/30 7:16:05
本文主要是介绍Ubuntu环境下解决‘ pip is being invoked by an old script wrapper. ...‘问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
当我们使用pip需要更新时,会提示如下警告:
You are using pip version 9.0.1, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
然而,使用提示的命令更新pip之后,每次安装模块时,会提示:
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
网上的很多答案都是使用 python -m pip install XXX 进行安装,这种安装方式比较麻烦,并没有解决问题的本质。出现改问题的原因主要是安装pip与更新pip的方式不匹配。当ubuntu系统不存在pip时,会提示使用 sudo apt install python3-pip 进行pip的安装,而更新是基于Python的方式进行管理,即 python -m pip install --upgrade pip 。
为了方便的进行pip的管理,可依靠python进行pip的安装,可参考pip说明文档进行安装。具体有两种方式:
1. python版本为3.10时,可执行
python -m ensurepip --upgrade
2. 利用get-pip.py文件进行安装
# 下载get-pip.py文件 wget https://bootstrap.pypa.io/get-pip.py # 在包含get-pip.py文件的目录下 python get-pip.py
这篇关于Ubuntu环境下解决‘ pip is being invoked by an old script wrapper. ...‘问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-04el-table 开启定时器下,表格的选中状态会消失是什么原因-icode9专业技术文章分享
- 2024-10-03如何安装和初始化飞牛私有云 fnOS?-icode9专业技术文章分享
- 2024-10-03如何安装 App 并连接到飞牛 NAS?-icode9专业技术文章分享
- 2024-10-03如何安装飞牛 TV 并连接到影视服务器?-icode9专业技术文章分享
- 2024-10-03如何在PVE和ESXI上安装飞牛私有云 fnOS?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS安装系统异常情况处理-icode9专业技术文章分享
- 2024-10-03飞牛NAS如何创建存储空间?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS硬盘会自动休眠吗?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS如何安装飞牛影视和创建媒体库?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS如何为家人朋友开通影视账号?-icode9专业技术文章分享