Search code examples
boto3ubuntu-18.04

How to install boto3 on Ubuntu 18.04?


How do you install boto3 on Ubuntu 18.04?

I tried this:

# 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
#

Solution

  • Partial answer found at 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
    

    Do not run pip install --upgrade pip, otherwise the following steps are also needed:

    from https://github.com/pypa/pip/issues/5240

    vi /usr/bin/pip3
    

    change the broken from pip import main import to

    from pip._internal import main
    

    and then finally

    pip3 install boto3