How to install pip with yum on EC2
I am using AWS with REL 7. by default the EC2 mico instance has python installed already.
but it comes across below error when i try to install pip on yum.
sudo yum install pip
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos No package. Error: do nothing
Anyone have any advice on how to install pip with yum?
source to share
To install pip3.6 on Amazon Linux. No python36-pip. If you install python34-pip it will also install python34 and point to it.
The best option that worked for me is the following:
#Download get-pip to current directory. It won't install anything, as of now
curl -O https://bootstrap.pypa.io/get-pip.py
#Use python3.6 to install pip
python3 get-pip.py
#this will install pip3 and pip3.6
Based on your preference, if you want to set them for all users, you can choose to run "sudo"
source to share
I faced this problem. I am using AWS RHEL 7.5 image.
$ cat /etc/system-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)
I have included repos extras
and optional
:
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
But sudo yum search pip
still didn't show the corresponding packages.
I downloaded the boottrap installer pip
and installed there (see Installing with get-pip.py ):
sudo curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
Please note that many packages pip
will require additional packages yum
, for example:
-
gcc
-
python-devel
source to share
The above answers seem to be specific to python3 and not python2. I am running an instance where Python defaults to 2.7.
python --version
Python 2.7.14
I just tried Python pip but it gave me pip for 2.6
To install pip for python 2.7, I have installed pyton27-pip package
sudo yum -y install python27-pip
This seemed to work for me.
source to share
In my case using docker image with AmazonLinux2 and Python 2.7, I have to enable epel first: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/
Then install with yum install python-pip
(because I am using root user).
source to share