简体   繁体   English

如何在aws实例ec2中更新python3中的pip

[英]How to update pip in python3 in aws instance ec2

I applied this command我应用了这个命令

 pip install --upgrade pip

The package shows error in installing python package:该包在安装 python 包时显示错误:

Collecting pip   
Permission denied: 

 **You are using pip version 9.0.3, however version 19.3.1 is available. You should consider upgrading via the 'pip install
 --upgrade pip' command.**

This command is not working in my aws ec2 linux terminal此命令在我的 aws ec2 linux 终端中不起作用

This command should work这个命令应该可以工作

 python -m pip install -U pip 

If this doesn't work and you get a permission error use this如果这不起作用并且您收到权限错误,请使用此

python -m pip install -U pip --user

In order to upgrade pip globally (ie for all users), you need sudo rights:为了全局升级pip (即所有用户),您需要sudo权限:

sudo pip install --upgrade pip

Alternatively, if you don't have sudo privileges you can still upgrade it for the current user:或者,如果您没有sudo权限,您仍然可以为当前用户升级它:

pip install --upgrade pip --user

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM