Recently, I had the need to compile Python 3.9 on AWS CloudShell which was necessary to create a Lambda Layer for the requests module.
This required add a C compiler to CloudShell. The steps are:
Step 1: Update packages.
sudo yum update
Step 2: Install GCC
sudo yum groupinstall “Development Tools”
Step 3: Check version
gcc –version
[cloudshell-user@ip-10-2-31-49]$ gcc –version
gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-15)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.