I am using AWS Cloud9 Amazon1 (EC2) instance.
Python 2.7 is pre-installed.
I am not sure where the python 3.7 is to be installed - home dir or root dir? Can someone help me with the steps to install python 3.7 such that it meets the following criteria:
If Python 3.7 is installed on the device, name the binary 'python3.7' and add its parent directory to the PATH environment variable.
Note that apt-get
is not supported. yum
works.
Update:
I have followed the steps from answer and installed python 3.7 successfully and checked by firing python3.7 -V
. However, the dependency checker is unable to detect the python 3.7:
mkdir greengrass-dependency-checker-GGCv1.11.x
cd greengrass-dependency-checker-GGCv1.11.x
wget https://github.com/aws-samples/aws-greengrass-samples/raw/master/greengrass-dependency-checker-GGCv1.11.x.zip
unzip greengrass-dependency-checker-GGCv1.11.x.zip
cd greengrass-dependency-checker-GGCv1.11.x
sudo ./check_ggc_dependencies | more
Based on the comments.
There is no native package for python 3.7 on Amazon Linux 1. Thus, it should be compiled as shown here. The compilation steps include:
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel
cd /usr/src
wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
tar xzf Python-3.7.9.tgz
cd Python-3.7.9
./configure --enable-optimizations
make altinstall
rm /usr/src/Python-3.7.9.tgz
Need to sym link pyhton:
ln -s /usr/local/bin/python3.7 /usr/bin/python3.7