pip: no module named _internal

前端 未结 26 2005
梦谈多话
梦谈多话 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:19

    Nothing worked for me, but only one thing: I used sudo in front of the command and it is working fine.

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

    I met the same error on Windows when I tried to install a package via pip3:

    Traceback (most recent call last):
      File "d:\anaconda\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "d:\anaconda\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "D:\Anaconda\Scripts\pip3.6.exe\__main__.py", line 5, in <module>
    ModuleNotFoundError: No module named 'pip._internal'
    

    My python is installed via Anaconda. I solved this issue by reinstalling pip via conda:

    conda install pip
    

    After that, pip returns to normal.

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

    my solution: first step like most other answer:

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

    second, add soft link

    sudo ln -s /usr/local/bin/pip /usr/bin/pip
    
    0 讨论(0)
  • 2020-12-02 12:22

    I tried the following command to solve the issue and it worked for me:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    python3 get-pip.py --force-reinstall
    
    0 讨论(0)
  • 2020-12-02 12:23

    For me

    python -m pip uninstall pip
    

    solved the issue. Reference

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

    (On windows) not sure why this was happening but I had my PYTHONPATH setup to point to c:\python27 where python was installed. in combination with virtualenv this produced the mentioned bug.

    resolved by removing the PYTHONPATH env var all together

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