0
votes

I've installed Lubuntu 16.04 LTS that comes with Python 3.5, but with Python 2.7 as default Python interpreter.
Both versions comes without pip package intalled. I only will use the 3.5 version. So I've installed pip3 with:

$ sudo apt-get install python3-pip

Then I tried to update the pip version (because the Ubuntu repositories have old versions): $ pip3 install --upgrade pip3 But pip3 can't locate pip3 package, and sends me this message:

Collecting pip3
Could not find a version that satisfies the requirement pip3 (from versions: ) No matching distribution found for pip3

After that, I tried this other:

$ pip3 intall --upgrade pip

And it updates from pip 8.1.1 to pip 8.1.2

pip 8.1.2 from /home/trimax/.local/lib/python3.5/site-packages (python 3.5)

If I try this:

$ pip -V

Doesn't work:

The program 'pip' is currently not installed. You can install it by typing: sudo apt-get install python-pip

But if I try this:

$ python3 -m pip -V

That works:

pip 8.1.2 from /home/trimax/.local/lib/python3.5/site-packages (python 3.5)

The question is Why runs pip as module but not as script?

2
does this work? $ pip3 -vMatthias Schreiber
Because pip has been never aliased to pip3 on your system. Usually, pip refers to pip for Python 2, but that's apparently not installed. You can make your own symlink for pip if you want to.user707650
Actually, there is likely a pip executable installed in /home/trimax/.local/bin/, but that directory is not on your path. Note that this path implies that you have used --user somewhere (in the upgrade?), but I don't see that mentioned in your question.user707650

2 Answers

3
votes

pip3 is in reality the pip package for python3. Since both python2 and python3 can coexist, the pip package for 3.5 is renamed as pip3 to avoid conflict. (By the package manager).

The upgrade syntax for any package is

<script_name_for_pip> install --upgrade <package_name>

and the package name is pip in pipy. That justifies why you have to provide pip as the package name and NOT pip3.

  • pip -v doesn't work because pip executable doesn't exist.

somewhat is a related note, you can also use the below to upgrade pip or any package for that matter.

easy_install-3.5 -U pip  
0
votes

PEP 394 describes naming of Python binaries, and according to its recommendations, you have pip3 in system because pip is reserved for Python 2.x pip.

Of course you can alias pip to pip3, but it's not recommended.