如何在亚马逊EC2 - Ubuntu上安装Python包,例如pip、numpy

5
需要在Ubuntu的Amazon EC2实例上安装像pip、numpy、cv2这样的Python包。我尝试使用sudo apt-get install python-pip命令,但是遇到了以下错误: ubuntu@ip-172-31-35-131:~$ sudo apt-get install python-pip Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python-pip
2个回答

8

首先尝试执行命令sudo apt-get update

然后执行命令sudo apt-get install python-pip


3
我用 sudo apt-get install python3-pip 安装成功了。 - David Beauchemin

3
你尝试过这里的说明吗?
你可以直接从PyPa安装pip:
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user

您的系统下可能有一个名为python3的并行python3.x版本,那么您可以使用python3 get-pip.py --user来为其安装pip。(或相反,名为python2的python2.x版本。)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接