pip: no module named _internal

前端 未结 26 2001
梦谈多话
梦谈多话 2020-12-02 12:08

I have a problem when I try to use pip in any way. I\'m using Ubuntu 16.04.4

I should say that I\'ve used it already, and I never had any problem, but starting today

相关标签:
26条回答
  • 2020-12-02 12:09

    I've seen this issue when PYTHONPATH was set to include the built-in site-packages directory. Since Python looks there automatically it is unnecessary and can be removed.

    0 讨论(0)
  • 2020-12-02 12:10

    Refer to this issue list

    sudo easy_install pip
    

    works for me under Mac OS

    For python3, may try sudo easy_install-3.x pip depends on the python 3.x version. Or python3 -m pip install --user --upgrade pip

    0 讨论(0)
  • 2020-12-02 12:12

    I just encountered the same problem and in my case, it turns out this is a conflict between the python installation in my virtualenv and the site-wide python (Ubuntu). What solves it for me is to run pip in this way, to force usage of the correct python installation (in my vortualenv):

    python3 -m pip install PACKAGE
    

    instead of

    pip3 install PACKAGE
    

    I realised this when I tried to follow some of the answers here that suggest re-installing pip and the error output I got was pointing to an existing site-wide python library path although I had activated my virtualenv. Worth trying before deleting and re-installing stuff.

    0 讨论(0)
  • 2020-12-02 12:13

    you can remove it first, and install again ,it will be ok. for centos:

    yum remove python-pip
    yum install python-pip
    
    0 讨论(0)
  • 2020-12-02 12:15

    This solution works for me:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    python3 get-pip.py --force-reinstall
    

    or use sudo for elevated permissions (sudo python3 get-pip.py --force-reinstall).

    Of course, you can also use python instead of python3 ;)

    Source

    0 讨论(0)
  • 2020-12-02 12:17

    The following solution solved the problem on my machine for python2.7 "$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py" and then "$ sudo python2.7 get-pip.py --force-reinstall"

    0 讨论(0)
提交回复
热议问题