-1

I just can't figure out how to get pip3 working on Ubuntu Server.

I've done:

sudo apt-get update

sudo apt-get upgrade

When running sudo python3 --version the output is 3.6.6.

I've tried the following:

sudo apt-get install python3-pip and python3-pip3, python-pip3, i've tried installing python3-setuptools and they appear to be installed but easy_install is not recognised as a command.

I think i've literally tried all options and the error unable to locate package python3-pip pops every time.

Mike
  • 466
  • 9
  • 24
  • I think I had that too once; I think there is some head-scratching going on between the `dist-packages` and `site-packages` directories. Check you Python path setting for packages and/or set it explicitly. There was a reason for why it is the way it is but I no longer recall what that was.. – Dirk Eddelbuettel Sep 30 '18 at 18:13
  • After installing with # apt install python3-pip Are you attempting to run pip from the command line as: $ pip3 or $ python3 -m pip ? – moo Sep 30 '18 at 18:20
  • @Mark i tried everything like: `sudo python3 pip install virtualenv` or `sudo pip`, `sudo pip3`, including the solution with `-m`. I dont get past apt install python3-pip because i get `unable to locate pack – Mike Sep 30 '18 at 18:27
  • the Ubuntu package for pip is called `python3-pip` to install it, you need to run `sudo apt install python3-pip` you then should be able run pip with `python3 -m pip install ...` can you say which error messages you are getting when any of these steps fail? – moo Sep 30 '18 at 18:36
  • 1
    In case it helps: in my case this was solved by adding "universe" to apt sources (see [this answer](https://askubuntu.com/a/1061488/865083)) – Ralf Nov 29 '18 at 19:50

1 Answers1

4

This is how I personally install pip, instead of worrying about the headache of finding it on various package managers.

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

Then use pip from python3 like so:

sudo python3 -m pip install <packagename>
Jebby
  • 1,845
  • 1
  • 12
  • 25