4
votes

Need to install python packages like pip, numpy, cv2 on EC2 instance of Ubuntu. I tried using sudo apt-get install python-pip but got below given error:

ubuntu@ip-172-31-35-131:~$ sudo apt-get install python-pip Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package python-pip

2

2 Answers

5
votes

Try first sudo apt-get update then

sudo apt-get install python-pip

3
votes

Have you tried the instructions here?

You can install pip from PyPa directly:

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

Your system may have a concurrent python3.x under the name python3, then you can install pip for it with python3 get-pip.py --user as well. (Or contrarily, python2.x under the name python2.)