0

I've a problem with pip3.

My problem was the same as described in this question.

I've tried a couple of solutions posted inside answers and comments and now I think I've (partially) solved.

The fact is that now, when I type the command pip3, I get the answer:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

but if I use sudo pip3 it seems to work fine.

My pip version (obtained with the command sudo pip3 --version) is:

pip 18.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)

my version of python is Python 3.5.2 (default, Nov 23 2017, 16:37:01) I'm working on a Linux machine with the following Ubuntu version installed:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:    16.04
Codename:   xenial

How can I make pip3 work as before?

Thank you very much for your support

Gonçalo Peres
  • 11,752
  • 3
  • 54
  • 83
orestino
  • 113
  • 1
  • 1
  • 8
  • 1
    For a start and to make it actually a valid question, you'd have to extract a [mcve]. Anyhow, I believe PIP can install packages for just one user and using `sudo` switches that user, so that would explain why things fail for another user. – Ulrich Eckhardt Oct 28 '18 at 09:22
  • 1
    Try reinstalling pip3. `sudo apt-get purge python3-pip` `sudo apt-get install python3-pip` – Raoslaw Szamszur Oct 28 '18 at 09:37
  • 1
    did you run the `pip uninstall …` command you linked to? those will/should be affecting the Python 2 install (`ls -l $(which pip)` might help you figure out which) and hence shouldn't make any difference to any Python 3 issues – Sam Mason Oct 28 '18 at 09:44
  • check python3 -m pip install "package" – fuwiak Oct 28 '18 at 11:15

0 Answers0