如何在Ubuntu 18.04上安装boto3?
我尝试过:
# pip install boto3
Command 'pip' not found, but can be installed with:
apt install python-pip
# apt install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
#
答案 0 :(得分:1)
这很简单,只需从终端安装
apt install python-boto3
答案 1 :(得分:0)
在https://askubuntu.com/questions/672808/sudo-apt-get-install-python-pip-is-failing
找到部分答案sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python3-pip
请勿运行pip install --upgrade pip
,否则还需要执行以下步骤:
来自https://github.com/pypa/pip/issues/5240
vi /usr/bin/pip3
将损坏的from pip import main
导入更改为
from pip._internal import main
然后最后
pip3 install boto3
答案 2 :(得分:0)
您发布的日志会通知您pip
和python-pip
命令尚未安装。因此,如果您仍然使用python 2(不推荐),则可以安装pip
或python-pip
sudo apt-get install pip
sudo apt-get install python-pip
然后安装boto3:sudo pip install boto3
。
否则,如果您已经在使用Python 3,则只需安装pip3
或python3-pip
sudo apt-get install pip3
sudo apt-get install python3-pip
然后安装boto3:sudo pip3 install boto3