In the virtual environment of python, I tried to use aws-cli and tried to execute the official command, but it didn't work, so a memorandum of the solution. I couldn't change the settings, so I deleted them all and reinstalled. (2020/03)
Macbook: MacOS Mojave Python: Python 3.8.0
According to the formula, do the following
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
However, when I checked the version with `` `$ aws --version```, an error occurred.
cannot execute binary file
I tried various things, but none of them worked, so I want to delete the files that I haven't specified once.
$ rm '/usr/local/bin/aws'
$ rm '/usr/local/bin/aws_completer'
Execute deletion with.
From there
$ pip install --user virtualenv
$ virtualenv ~/[Virtual environment name]
Create a new virtual environment with
#Activate virtual environment
$ source ~/[Virtual environment name]/bin/activate
Pip install awscli into the new virtual environment
([Virtual environment name])~$ pip install --upgrade awscli
Check if awscli is installed correctly
$ aws --version
aws-cli/1.18.23 Python/3.8.0 Darwin/18.7.0 botocore/1.15.23
Installation was successful! After this, I was able to confirm that the aws command was also used normally!
I googled a lot, but the official website was the strongest.
Reference / citation source Install AWS CLI version 1 in a virtual environment (official site)
(By the way, I tried to install AWS CLI version 2 and it failed, so installing version 1 solved it.) Click here for version 2 installation official ↓ Installing AWS CLI version 2 on Linux (official site)
Recommended Posts