32

I am use AWS with REL 7. the default EC2 mico instance has already install python.

but it encounter below error when i try to install pip by yum.

sudo yum install pip

Loaded plugins: amazon-id, rhui-lb, search-disabled-repos No package pip available. Error: Nothing to do

Anyone advise on how to install pip with yum?

1
  • the OS of EC2 is RHEL-7.3_HVM
    – Baodi Di
    Commented Jul 13, 2017 at 7:12

9 Answers 9

55

The following worked for me on Amazon Linux AMI 2:

sudo yum -y install python-pip

2
  • Note that to run it you have to say python3 -m pip <args>
    – beasy
    Commented Oct 3, 2019 at 18:32
  • 3
    also worked for me in Amazon Linux 2023 Commented Mar 26 at 20:13
33

To install pip3.6 in Amazon Linux., there is 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 like to install them for all users, you may choose to run it as 'sudo'

1
  • 2
    Worked like a charm.. in my case, Amazon linux has default Python version 2.7.14. Hence the second command was sudo python get-pip.py Commented Aug 30, 2018 at 2:21
17

You can see what is available by executing

yum search pip

In my case I see

...
python2-pip.noarch : A tool for installing and managing Python 2 packages
python3-pip.noarch : A tool for installing and managing Python3 packages

So, you can install the version that you need. Since the default instance seems to have Python 2 installed, you probably want python2-pip. Thus:

sudo yum install python2-pip

and away you go.

8

if you have already installed python you might want to install pip by: sudo yum install python("version")-pip for example:

sudo yum install python34-pip
5
  • 1
    still cannot find package...$ sudo yum install python34-pip Loaded plugins: amazon-id, rhui-lb, search-disabled-repos rhui-REGION-client-config-server-7 | 2.9 kB 00:00 rhui-REGION-rhel-server-releases | 3.5 kB 00:00 rhui-REGION-rhel-server-rh-common | 3.8 kB 00:00 (1/2): rhui-REGION-rhel-server-releases/7Server/x86_64/upd | 1.9 MB 00:00 (2/2): rhui-REGION-rhel-server-releases/7Server/x86_64/pri | 38 MB 00:01 No package python34-pip available. Error: Nothing to do
    – Baodi Di
    Commented Jul 24, 2017 at 2:12
  • this the version what i used now:]$ sudo yum list python Loaded plugins: amazon-id, rhui-lb, search-disabled-repos Installed Packages python.x86_64 2.7.5-48.el7 @anaconda/7.3
    – Baodi Di
    Commented Jul 24, 2017 at 2:16
  • try different version of python. if you have python python-2.7.5. you need to install pip of that version.
    – user8231578
    Commented Jul 31, 2017 at 8:06
  • cannot find I try to list and grep[ec2-user@ip-172-31-26-241 ~]$ sudo yum list|grep python|grep pip [ec2-user@ip-172-31-26-241 ~]$
    – Baodi Di
    Commented Jul 31, 2017 at 9:33
  • sudo yum install python2-pip, or sudo yum install python3-pip, and so on
    – Jordan
    Commented Feb 24, 2020 at 20:52
4

There are different ways but this seems to be promising for me.

sudo yum install python3-pip

I prefer searching any package name first and then enter full name which I want to install.

yum search pip

this will give you results if any package with name pip.

Check if your installation is valid by pip3 --version which should print latest installed version on your system.

2

Install python and then install pip

sudo yum install python34-pip
2

I ran into this problem as well. I am using the AWS RHEL 7.5 image.

$ cat /etc/system-release
Red Hat Enterprise Linux Server release 7.5 (Maipo)

I enabled the extras and optional repos:

sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

But sudo yum search pip still did not show any relevant packages.

I downloaded the pip bootstrap installer and installed from there (see Installing with get-pip.py):

sudo curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

Note that many pip packages will require additional yum packages as well, e.g.:

  • gcc
  • python-devel
0
0

The above answers seem to apply to python3 not python2 I'm running an instance where the default Python is 2.7

python --version
Python 2.7.14

I just tried to python-pip but it gave me pip for 2.6

To install pip for python 2.7 I installed the package pyton27-pip

sudo yum -y install python27-pip

That seemed to work for me.

0

In my case is using docker with AmazonLinux2 image and python 2.7, I have to enable epel first : https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/

Then install by using yum install python-pip (because I'm using root user).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.