[LINUX] Solution when aws-cli cannot be executed on Mac virtual environment (after installing Python 3.8)

Background

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)

specification

Macbook: MacOS Mojave Python: Python 3.8.0

install aws-cli

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

debug

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!

Summary

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

Solution when aws-cli cannot be executed on Mac virtual environment (after installing Python 3.8)
Error and solution when installing python3 with homebrew on mac (catalina 10.15)
"Temporary solution" when pip cannot be updated [Python]
Notes on installing Python on Mac
Solution when the image cannot be displayed with tkinter [python]
Create a virtual environment for python on mac [Very easy]
Error when building mac python environment
Create a Python environment on Mac (2017/4)
Support when installing pillow on python3.9
Python environment construction memo on Mac
Environment construction of python3.8 on mac
Things to watch out for when creating a Python environment on a Mac
Python virtual environment and packages on Ubuntu
Create a python environment on your Mac
[Mac] Building a virtual environment for Python
Creating a python virtual environment on Windows
Build Python environment with Anaconda on Mac
[AWS] Problem avoidance memo when installing awscli and boto3 in Python 2.7 environment
Check! Troubleshooting when installing PyObjc on Mac
How to build an environment when you want to use python2.7 after installing Anaconda3
[Mac OS] Problem of crashing when starting Cent OS after installing Cent OS in Virtual Box
Correspondence memo when the direction key cannot be used on the python command line
[Linux] When "| (pipe)" cannot be hit on CentOS7
Build a Python environment on Mac (Mountain Lion)
Python environment settings (virtualenv + pip cannot be done)
Investigation when import cannot be done with python
Build a Python development environment on your Mac
[Venv] Create a python virtual environment on Ubuntu
[Node-RED] Execute Python on Anaconda virtual environment from Node-RED [Anaconda] [Python]
Create a Python virtual development environment on Windows
python on mac
Python note: When the pip command cannot be used
Install Python3 on Mac and build environment [Definitive Edition]
Install Python venv --VSCode --GitHub integration environment on Mac
Build a machine learning Python environment on Mac OS
Build a Python development environment on Mac OS X
Causes when python version cannot be changed using pyenv
Build a Python environment on your Mac using pyenv
When import matplotlib.pyplot cannot be done in pyenv-virtualenv environment
Installing Python 3 on Mac and checking basic operation Part 1
Install Python environment on local PC (pyenv, venv on Mac)
Minimum memo when using Python on Mac (pyenv edition)
Minimum notes when using Python on Mac (Homebrew edition)
Note: When Python is run on ImageJ Fiji, java.lang.IllegalArgumentException appears and its solution (mac OS)
Install Python on Mac
Install Python 3 on Mac
python virtual environment Pipenv
Installing pandas on python2.6
virtual environment in python
Install Python 3.4 on Mac
Mac environment construction Python
Virtual environment with Python 3.6
Python environment construction on Mac (pyenv, virtualenv, anaconda, ipython notebook)
Create a Python (pyenv / virtualenv) development environment on Mac (Homebrew)
How to build a new python virtual environment on Ubuntu
[Python] Anaconda environment construction (installation, startup, virtual environment, package management) Mac environment
Building a Python environment on a Mac and using Jupyter lab
Options when installing libraries that cannot be piped with pyenv
Video cannot be loaded with Spyder in Python development environment
Build a python data analysis environment on Mac (El Capitan)
After enabling the python virtual environment in the batch file, run the python file