Follow below steps to install pip on AWS EC2 instance –
Step 1: Check if Python is installed in your EC2 instance and install Python if not already installed.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
## Check python version python --version ## If above command fails, then install Python using below command based on your EC2 instance OS. ## On Debian OS, such as Ubuntu, use APT. sudo apt-get install python3.7 ## On RHEL OS, such as CentOS, use yum sudo yum install python37 ## On Suse OS, use zypper. sudo zypper install python3-3.7 |
Step 2: Install pip in your EC2 instance
1 2 3 4 5 6 7 8 |
## Download the script to install pip curl -O https://bootstrap.pypa.io/get-pip.py ## Execute the script to install pip python3 get-pip.py --user ## Check if pip installation was a sucess pip --version |