To Nha Notes | Aug. 1, 2022, 12:16 p.m.
To create an isolated Python environment for Amazon Linux 2, you must:
1. Install Python 3 for Amazon Linux 2.
2. Install a virtual environment under the ec2-user home directory.
3. Activate the environment, and then install Boto 3.
yum install python3 -y
python3 -m venv my_app/env
source ~/my_app/env/bin/activate
pip install pip --upgrade
pip install boto3
(env) [ec2-user ~]$ python
References
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-python3-boto3/