user3334871
user3334871

Reputation: 1361

Error installing awscli using pip (macOS)

I'm trying to install Amazon's awscli onto my mac, and I am running into a few errors that I'm not able to diagnose. I've followed all the steps so far in this link, but when I actually try to install awscli, it gives me the following error:

  Could not find a version that satisfies the requirement awscli (from versions: )
No matching distribution found for awscli

The full trace of what is happening is

bash-3.2$ ./Library/Python/2.7/bin/pip install awscli --upgrade --user
Collecting awscli
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b0d4390>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /simple/awscli/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b0d4890>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /simple/awscli/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b0d4d10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /simple/awscli/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b0d4d50>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /simple/awscli/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x10b0d4690>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /simple/awscli/
 Could not find a version that satisfies the requirement awscli (from versions: )
No matching distribution found for awscli

I'm almost 100% sure that there is a connection error to the resource I am trying to install, but since the command comes directly from Amazon, it shouldn't be outdated? Also, I am running pip version 9.0.1, so there shouldn't be an out of date issue.

Upvotes: 1

Views: 2447

Answers (4)

Tapan Hegde
Tapan Hegde

Reputation: 1328

Facing similar error while installing awscli on my mac machine(Mojave version). Followed below steps to resolve it.

  1. Try to install awscli using brew.

    brew install awscli
    
  2. Reference link :

    https://vyspiansky.github.io/2018/03/17/install-aws-cli-on-macos/

    This link helped me. Hope this helps!!.

Upvotes: 0

user5359531
user5359531

Reputation: 3555

I have found the easiest way is to just install it with conda;

https://anaconda.org/conda-forge/awscli

You can use some commands like this:

$ wget "https://repo.continuum.io/miniconda/Miniconda3-4.5.4-MacOSX-x86_64.sh"
$ bash "Miniconda3-4.5.4-MacOSX-x86_64.sh" -b -p "${PWD}/conda"
$ source "${PWD}/conda/bin/activate"
(base) $ conda config --add channels conda-forge
(base) $ conda install -y -c conda-forge awscli=1.16.29
(base) $ aws --version
aws-cli/1.16.29 Python/3.6.5 Darwin/16.7.0 botocore/1.12.19

The caveat is that you will need to use this conda installation whenever you need to use the AWS CLI, but its easier than messing with system-wide installations or pip configs, IMO, and conda is more robust than a Python virtual env.

Upvotes: 0

user5359531
user5359531

Reputation: 3555

You should be able to follow the other set of instructions there:

https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html

Install the AWS CLI Using the Bundled Installer

Follow these steps from the command line to install the AWS CLI using the bundled installer.

To install the AWS CLI using the bundled installer

Download the AWS CLI Bundled Installer.

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

Unzip the package.

$ unzip awscli-bundle.zip

Note

If you don't have unzip, use your Linux distribution's built in package manager to install it.

Run the install executable.

$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Note

By default, the install script runs under the system default version of Python. If you have installed an alternative version of Python and want to use that to install the AWS CLI, run the install script with that version by absolute path to the Python executable. For example:

$ sudo /usr/local/bin/python2.7 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

The installer installs the AWS CLI at /usr/local/aws and creates the symlink aws at the /usr/local/bin directory. Using the -b option to create a symlink eliminates the need to specify the install directory in the user's $PATH variable. This should enable all users to call the AWS CLI by typing aws from any directory.

To see an explanation of the -i and -b options, use the -h option:

$ ./awscli-bundle/install -h

Upvotes: 1

CBP
CBP

Reputation: 799

This worked for me. Hope this helps other people who encounter this issue.

brew install python3    
pip3 install awscli --upgrade --user

Upvotes: 3

Related Questions