代码改变世界

关于近期pip报错:WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.

2020-12-14 16:03  lzhshn  阅读(11683)  评论(0编辑  收藏  举报

环境是mac机!

下载官方python包正常,第一次运行pip3,版本为:

pip        19.2.3

 

但是会出现警告提示:

WARNING: You are using pip version 19.2.3, however version 20.3.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

 

进行升级:

pip3 install --upgrade pip --user

 

安装可以完成,但是出现新的错误,也就是标题提到的那个:

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.

 

解决办法是:

比如原来使用pip3 list(能正常工作,但是会报错),改为:

python3 -m pip list

即可!!!