50

I've read in multiple places that python3.4 ships with pip. My OS is Lubuntu 14.04 and the default python version is Python 2.7.6 but in

/usr/bin

it says I have python3.4 installed (when I run python3 -V it says I have Python 3.4.0). I made this post earlier last week: How do I use pip 3 with Python 3.4?

One of the comments to the reply said that "It may be worth mentioning that python3.4 should always ship pip by default. So python3 -m pip should work out of the box. If not, there's python -m ensurepip to bootstrap pip. get-pip.py should not be necessary here."

I can confirm that I do not have pip because I did

pip -V

and it said that pip is currently not installed. I tried running

python3 -m pip

and it said

/usr/bin/python3: No module named pip

I then tried

python -m ensurepip
python3 -m ensurepip

and it said

/usr/bin/python: No module named ensurepip
/usr/bin/python3: No module named ensurepip

With that said, is there something wrong with my version of python3 because it does not have pip or ensurepip? I'm asking because I've read in multiple places (for example, in my previous question) that python3.4 comes with pip and I don't think that is true for my case.

My end goal is to run Django1.8 using python 3.4.3.

Community
  • 1
  • 1
SilentDev
  • 20,997
  • 28
  • 111
  • 214
  • @jakekimds I'm not sure if you read my post / question but I already know how to install pip. Thanks though. – SilentDev Apr 25 '15 at 22:32
  • 1
    `python -m ensurepip` is using the python2 interpreter, did you actually try installing with get-pip? – Padraic Cunningham Apr 25 '15 at 22:35
  • @user2719875 I thought your post was about if PIP ships with Python3 by default? I just installed Python 3 and PIP didn't come with mine either. – jkd Apr 25 '15 at 22:37
  • @user2719875 `python3 -m ensurepip` works for me – jkd Apr 25 '15 at 22:39
  • @PadraicCunningham I didn't try installing pip yet. I'm just wondering why websites like these: https://docs.python.org/3/whatsnew/3.4.html / https://docs.python.org/3/whatsnew/3.4.html#whatsnew-pep-453 and http://stackoverflow.com/questions/29712519/how-to-use-pip3-with-python-3-4 state that "pip should always be available" and "The version of pip included with Python 3.4.0 is pip 1.5.4" and "python3.4 should always ship pip by default" and "there's python -m ensurepip to bootstrap pip. get-pip.py should not be necessary here." when my python3 does not have pip or ensurepip. – SilentDev Apr 25 '15 at 22:45
  • @PadraicCunningham in addition to my comment above, I just want to verify if there is something wrong with my python3 or if there is something wrong with the documentation / websites which state that python3 automatically ships with pip / ensurepip. – SilentDev Apr 25 '15 at 22:47
  • @jakekimds strange, when I do "python3 -m ensurepip" it says "/usr/bin/python3: No module named ensurepip". Can you verify which version of python3 you have? Maybe python3.4.0 does not have pip / ensurepip but python3.4.3 does? – SilentDev Apr 25 '15 at 22:50
  • @user2719875 I recently installed 3.4.3 (sorry). It also comes with the pip module. – jkd Apr 25 '15 at 22:54
  • 1
    @jakekimds okay thanks. I'm now under the impression that python3.4.0 has no pip / ensurepip but python3.4.3 does. What's confusing me is that over here: https://docs.python.org/3/whatsnew/3.4.html#whatsnew-pep-453 it says "The version of pip included with Python 3.4.0 is pip 1.5.4". For now, I'll just install python3.4.3. – SilentDev Apr 25 '15 at 22:58

3 Answers3

47

On Ubuntu and other Debian derivatives you have to install python3-pip to get Python3’s pip.

apt-get install python3-pip
Joshua Ryan
  • 628
  • 5
  • 12
Robert Siemer
  • 32,405
  • 11
  • 84
  • 94
20

You can try below code for pip installation on Ubuntu.

sudo apt update
sudo apt install python3-pip
Moon
  • 4,014
  • 3
  • 30
  • 66
7

On Ubuntu Focal/20.04, got the same error

❯ python3 -m ensurepip --upgrade
/usr/bin/python3: No module named ensurepip

Disable for System Python

It looks like it's disable for system python as described by Python2 interpreter output:

❯ python2 -m ensurepip --upgrade
ensurepip is disabled in Debian/Ubuntu for the system python.

Python modules For the system python are usually handled by dpkg and apt-get.

    apt-get install python-<module name>

Install the python-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.

Solution

Use apt to install it:

apt install python3-pip
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178