pip: no module named _internal

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

    These often comes from using pip to "update" system installed pip, and/or having multiple pip installs under user. My solution was to clean out the multiple installed pips under user, reinstall pip repo, then "pip install --user pip" as above.

    See: https://github.com/pypa/pip/issues/5599 for an official complete discussion and fixes for the problem.

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

    For completeness, I just encountered this problem with "Ubuntu latest" ... v18.04 ... and fixed it in this way:

    python3 -m pip install --upgrade pip

    (Notice that it was necessary to specify python3 since this references Python 3.6.9. The python command on the same system references Python 2.7.17. Since this is apparently a system-wide installation it encountered a ["not sudo" ...] permission error, but it didn't matter because it was the wrong thing to do anyway. I was encountering the problem with pip3.)

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

    For the current user only:

    easy_install --user pip

    or

    python -m pip install --upgrade --user pip

    The second may give /usr/bin/python: No module named pip Even if which pip finds the module named pip. In this case try the easy_install

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

    In file "/usr/local/bin/pip" change from pip._internal import main to from pip import main

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

    This did it for me:

    python -m pip install --upgrade pip
    

    Environment: OSX && Python installed via brew

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

    I have the same problem on my virtual environment after upgrade python installation from 3.6 to 3.7 but only on vent globally pip work fine, to solve it I deactivate and delete my virtual environment after recreate again and now is fine, on venv:

    deactivate
    rm -rvf venv 
    

    and after recreate the virtual environment. I use mac OS 10.11, and python 3

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