Pip is not working: ImportError: No module named 'pip._internal'Is `sudo pip install` still a broken...

What is the generally accepted pronunciation of “topoi”?

Trig Subsitution When There's No Square Root

What materials can be used to make a humanoid skin warm?

Can we track matter through time by looking at different depths in space?

Finitely many repeated replacements

What would be the most expensive material to an intergalactic society?

How to design an organic heat-shield?

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

(Codewars) Linked Lists - Remove Duplicates

Why is there an extra space when I type "ls" in the Desktop directory?

Gaining more land

For which categories of spectra is there an explicit description of the fibrant objects via lifting properties?

Getting the || sign while using Kurier

Why does Solve lock up when trying to solve the quadratic equation with large integers?

After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?

Can't make sense of a paragraph from Lovecraft

How does Ehrenfest's theorem apply to the quantum harmonic oscillator?

Outlet with 3 sets of wires

Rationale to prefer local variables over instance variables?

How many characters using PHB rules does it take to be able to have access to any PHB spell at the start of an adventuring day?

School performs periodic password audits. Is my password compromised?

How do electrons receive energy when a body is heated?

Specifying a starting column with colortbl package and xcolor

Do I really need to have a scientific explanation for my premise?



Pip is not working: ImportError: No module named 'pip._internal'


Is `sudo pip install` still a broken practice?installing ecdsahow do i get geany to run python 2.7.3 not python version 3ImportError: No module named paramikoUpdate Manager doesn't work “ImportError: No module named 'codecs'”python3 - ImportError: No module named '_chipset'Backintime won't start (no module named dbus)How to use the ansible.runner module on Ubuntu 14.04.5?PlayOnLinux won't launchAbout Object detection tensorflow . help me please













42















Running pip or pip3 results with:



Traceback (most recent call last):
File "/home/myuser/.local/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named 'pip._internal'


I had issues with this, and uninstalled pip3, but when i try to install it again using



sudo apt-get -y install python3-pip


it does install, but then running pip or pip3 i get the same error.



#which pip3
/home/myuser/.local/bin/pip3









share|improve this question




















  • 2





    I have a similar problem after upgrading from pip 9.0.2 to pip-10.0.0. Ubuntu 16.04LTS here.

    – Dave
    Apr 15 '18 at 11:19






  • 2





    You should not upgrade to pip 10 on Ubuntu, because the system version installed through apt is modified in a way not compatible to pip 10. See github.com/pypa/pip/issues/5221 @Dave

    – Byte Commander
    Apr 15 '18 at 12:27













  • macOS 10.13.4, same problem after upfgrade to pip 10

    – Benjamin R
    Apr 21 '18 at 4:38






  • 1





    Temporary workaround: python3 -m pip install --user <package>

    – Benjamin R
    Apr 21 '18 at 22:14






  • 1





    if you have easy_install (comes from python-setuptools package), you can do sudo easy_install pip (or sudo easy_install3 pip for python3-only, etc.)

    – Marek Sebera
    May 25 '18 at 14:40
















42















Running pip or pip3 results with:



Traceback (most recent call last):
File "/home/myuser/.local/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named 'pip._internal'


I had issues with this, and uninstalled pip3, but when i try to install it again using



sudo apt-get -y install python3-pip


it does install, but then running pip or pip3 i get the same error.



#which pip3
/home/myuser/.local/bin/pip3









share|improve this question




















  • 2





    I have a similar problem after upgrading from pip 9.0.2 to pip-10.0.0. Ubuntu 16.04LTS here.

    – Dave
    Apr 15 '18 at 11:19






  • 2





    You should not upgrade to pip 10 on Ubuntu, because the system version installed through apt is modified in a way not compatible to pip 10. See github.com/pypa/pip/issues/5221 @Dave

    – Byte Commander
    Apr 15 '18 at 12:27













  • macOS 10.13.4, same problem after upfgrade to pip 10

    – Benjamin R
    Apr 21 '18 at 4:38






  • 1





    Temporary workaround: python3 -m pip install --user <package>

    – Benjamin R
    Apr 21 '18 at 22:14






  • 1





    if you have easy_install (comes from python-setuptools package), you can do sudo easy_install pip (or sudo easy_install3 pip for python3-only, etc.)

    – Marek Sebera
    May 25 '18 at 14:40














42












42








42


16






Running pip or pip3 results with:



Traceback (most recent call last):
File "/home/myuser/.local/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named 'pip._internal'


I had issues with this, and uninstalled pip3, but when i try to install it again using



sudo apt-get -y install python3-pip


it does install, but then running pip or pip3 i get the same error.



#which pip3
/home/myuser/.local/bin/pip3









share|improve this question
















Running pip or pip3 results with:



Traceback (most recent call last):
File "/home/myuser/.local/bin/pip", line 7, in <module>
from pip._internal import main
ImportError: No module named 'pip._internal'


I had issues with this, and uninstalled pip3, but when i try to install it again using



sudo apt-get -y install python3-pip


it does install, but then running pip or pip3 i get the same error.



#which pip3
/home/myuser/.local/bin/pip3






python pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 15 '18 at 11:25









Yaron

9,17871940




9,17871940










asked Apr 15 '18 at 10:44









user3087079user3087079

311125




311125








  • 2





    I have a similar problem after upgrading from pip 9.0.2 to pip-10.0.0. Ubuntu 16.04LTS here.

    – Dave
    Apr 15 '18 at 11:19






  • 2





    You should not upgrade to pip 10 on Ubuntu, because the system version installed through apt is modified in a way not compatible to pip 10. See github.com/pypa/pip/issues/5221 @Dave

    – Byte Commander
    Apr 15 '18 at 12:27













  • macOS 10.13.4, same problem after upfgrade to pip 10

    – Benjamin R
    Apr 21 '18 at 4:38






  • 1





    Temporary workaround: python3 -m pip install --user <package>

    – Benjamin R
    Apr 21 '18 at 22:14






  • 1





    if you have easy_install (comes from python-setuptools package), you can do sudo easy_install pip (or sudo easy_install3 pip for python3-only, etc.)

    – Marek Sebera
    May 25 '18 at 14:40














  • 2





    I have a similar problem after upgrading from pip 9.0.2 to pip-10.0.0. Ubuntu 16.04LTS here.

    – Dave
    Apr 15 '18 at 11:19






  • 2





    You should not upgrade to pip 10 on Ubuntu, because the system version installed through apt is modified in a way not compatible to pip 10. See github.com/pypa/pip/issues/5221 @Dave

    – Byte Commander
    Apr 15 '18 at 12:27













  • macOS 10.13.4, same problem after upfgrade to pip 10

    – Benjamin R
    Apr 21 '18 at 4:38






  • 1





    Temporary workaround: python3 -m pip install --user <package>

    – Benjamin R
    Apr 21 '18 at 22:14






  • 1





    if you have easy_install (comes from python-setuptools package), you can do sudo easy_install pip (or sudo easy_install3 pip for python3-only, etc.)

    – Marek Sebera
    May 25 '18 at 14:40








2




2





I have a similar problem after upgrading from pip 9.0.2 to pip-10.0.0. Ubuntu 16.04LTS here.

– Dave
Apr 15 '18 at 11:19





I have a similar problem after upgrading from pip 9.0.2 to pip-10.0.0. Ubuntu 16.04LTS here.

– Dave
Apr 15 '18 at 11:19




2




2





You should not upgrade to pip 10 on Ubuntu, because the system version installed through apt is modified in a way not compatible to pip 10. See github.com/pypa/pip/issues/5221 @Dave

– Byte Commander
Apr 15 '18 at 12:27







You should not upgrade to pip 10 on Ubuntu, because the system version installed through apt is modified in a way not compatible to pip 10. See github.com/pypa/pip/issues/5221 @Dave

– Byte Commander
Apr 15 '18 at 12:27















macOS 10.13.4, same problem after upfgrade to pip 10

– Benjamin R
Apr 21 '18 at 4:38





macOS 10.13.4, same problem after upfgrade to pip 10

– Benjamin R
Apr 21 '18 at 4:38




1




1





Temporary workaround: python3 -m pip install --user <package>

– Benjamin R
Apr 21 '18 at 22:14





Temporary workaround: python3 -m pip install --user <package>

– Benjamin R
Apr 21 '18 at 22:14




1




1





if you have easy_install (comes from python-setuptools package), you can do sudo easy_install pip (or sudo easy_install3 pip for python3-only, etc.)

– Marek Sebera
May 25 '18 at 14:40





if you have easy_install (comes from python-setuptools package), you can do sudo easy_install pip (or sudo easy_install3 pip for python3-only, etc.)

– Marek Sebera
May 25 '18 at 14:40










6 Answers
6






active

oldest

votes


















78














After upgrading pip (or pip3, in this case) if the following occurs:



$ ~ pip3 -V
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip._internal import main
ModuleNotFoundError: No module named 'pip._internal'


Force a reinstall of pip:



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


Verify install:



$ ~ pip3 -V
pip 10.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)


Now pip3 install <package> and pip3 install --user <package> (for user-level installs) will work correctly.



There should never, ever be any reason you need to run pip in elevated mode.



(note: For Python 2.7, just replace python for python3, and pip for pip3)



Had same problem on macOS as well, it's a common issue across platforms.






share|improve this answer



















  • 1





    works as fine for the raspberry too

    – gtatr
    Jul 11 '18 at 19:53






  • 1





    you, sir, are a hero. had this problem on solus and it worked like a charm.

    – cirrusio
    Jul 18 '18 at 3:16






  • 1





    @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

    – Benjamin R
    Aug 23 '18 at 8:57








  • 1





    @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

    – Benjamin R
    Aug 24 '18 at 14:35








  • 1





    @endolith Okay! See: fosslinux.com/3534/…

    – Benjamin R
    Aug 25 '18 at 11:57



















8














This command also works, it reinstalls the pip:



sudo easy_install pip






share|improve this answer



















  • 3





    That's the easiest answer!

    – Serge Stroobandt
    Aug 8 '18 at 17:16






  • 3





    Worked like a wonder on Ubuntu

    – user2849789
    Sep 9 '18 at 0:53





















2














I got the same problem as you just now, I found the reason is that you are working without superuser privilege since some internal python packages or modules are installed under superuser privilege.



So you can try by fist entering sudo su, then enter your password, and run pip install, it might help.






share|improve this answer



















  • 2





    You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

    – Benjamin R
    Apr 21 '18 at 4:44






  • 1





    However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

    – Yuke
    Apr 22 '18 at 5:21








  • 2





    Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

    – Yuke
    Apr 22 '18 at 5:36













  • My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

    – Benjamin R
    Apr 23 '18 at 7:34











  • Hmmm askubuntu.com/a/802594/5032

    – endolith
    Aug 21 '18 at 10:40



















1














Apply these three steps:




  1. Go to /usr/local/bin by terminal

  2. Execute sudo gedit pip

  3. Change the from pip._internal import main into from pip import main.






share|improve this answer

































    0














    The pip version now is 19.0.1:



    which pip3
    #/home/xxx/.local/bin/pip3
    vim /home/xxx/.local/bin/pip3


    Change from pip._internal import main into from pip import main






    share|improve this answer































      0














      I solved this by updating pip via Python, like this:



      python2 -m pip install --user --upgrade pip



      python3 -m pip install --user --upgrade pip






      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1025189%2fpip-is-not-working-importerror-no-module-named-pip-internal%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        78














        After upgrading pip (or pip3, in this case) if the following occurs:



        $ ~ pip3 -V
        Traceback (most recent call last):
        File "/usr/local/bin/pip", line 7, in <module>
        from pip._internal import main
        ModuleNotFoundError: No module named 'pip._internal'


        Force a reinstall of pip:



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


        Verify install:



        $ ~ pip3 -V
        pip 10.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)


        Now pip3 install <package> and pip3 install --user <package> (for user-level installs) will work correctly.



        There should never, ever be any reason you need to run pip in elevated mode.



        (note: For Python 2.7, just replace python for python3, and pip for pip3)



        Had same problem on macOS as well, it's a common issue across platforms.






        share|improve this answer



















        • 1





          works as fine for the raspberry too

          – gtatr
          Jul 11 '18 at 19:53






        • 1





          you, sir, are a hero. had this problem on solus and it worked like a charm.

          – cirrusio
          Jul 18 '18 at 3:16






        • 1





          @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

          – Benjamin R
          Aug 23 '18 at 8:57








        • 1





          @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

          – Benjamin R
          Aug 24 '18 at 14:35








        • 1





          @endolith Okay! See: fosslinux.com/3534/…

          – Benjamin R
          Aug 25 '18 at 11:57
















        78














        After upgrading pip (or pip3, in this case) if the following occurs:



        $ ~ pip3 -V
        Traceback (most recent call last):
        File "/usr/local/bin/pip", line 7, in <module>
        from pip._internal import main
        ModuleNotFoundError: No module named 'pip._internal'


        Force a reinstall of pip:



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


        Verify install:



        $ ~ pip3 -V
        pip 10.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)


        Now pip3 install <package> and pip3 install --user <package> (for user-level installs) will work correctly.



        There should never, ever be any reason you need to run pip in elevated mode.



        (note: For Python 2.7, just replace python for python3, and pip for pip3)



        Had same problem on macOS as well, it's a common issue across platforms.






        share|improve this answer



















        • 1





          works as fine for the raspberry too

          – gtatr
          Jul 11 '18 at 19:53






        • 1





          you, sir, are a hero. had this problem on solus and it worked like a charm.

          – cirrusio
          Jul 18 '18 at 3:16






        • 1





          @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

          – Benjamin R
          Aug 23 '18 at 8:57








        • 1





          @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

          – Benjamin R
          Aug 24 '18 at 14:35








        • 1





          @endolith Okay! See: fosslinux.com/3534/…

          – Benjamin R
          Aug 25 '18 at 11:57














        78












        78








        78







        After upgrading pip (or pip3, in this case) if the following occurs:



        $ ~ pip3 -V
        Traceback (most recent call last):
        File "/usr/local/bin/pip", line 7, in <module>
        from pip._internal import main
        ModuleNotFoundError: No module named 'pip._internal'


        Force a reinstall of pip:



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


        Verify install:



        $ ~ pip3 -V
        pip 10.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)


        Now pip3 install <package> and pip3 install --user <package> (for user-level installs) will work correctly.



        There should never, ever be any reason you need to run pip in elevated mode.



        (note: For Python 2.7, just replace python for python3, and pip for pip3)



        Had same problem on macOS as well, it's a common issue across platforms.






        share|improve this answer













        After upgrading pip (or pip3, in this case) if the following occurs:



        $ ~ pip3 -V
        Traceback (most recent call last):
        File "/usr/local/bin/pip", line 7, in <module>
        from pip._internal import main
        ModuleNotFoundError: No module named 'pip._internal'


        Force a reinstall of pip:



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


        Verify install:



        $ ~ pip3 -V
        pip 10.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)


        Now pip3 install <package> and pip3 install --user <package> (for user-level installs) will work correctly.



        There should never, ever be any reason you need to run pip in elevated mode.



        (note: For Python 2.7, just replace python for python3, and pip for pip3)



        Had same problem on macOS as well, it's a common issue across platforms.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 21 '18 at 5:07









        Benjamin RBenjamin R

        1,160816




        1,160816








        • 1





          works as fine for the raspberry too

          – gtatr
          Jul 11 '18 at 19:53






        • 1





          you, sir, are a hero. had this problem on solus and it worked like a charm.

          – cirrusio
          Jul 18 '18 at 3:16






        • 1





          @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

          – Benjamin R
          Aug 23 '18 at 8:57








        • 1





          @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

          – Benjamin R
          Aug 24 '18 at 14:35








        • 1





          @endolith Okay! See: fosslinux.com/3534/…

          – Benjamin R
          Aug 25 '18 at 11:57














        • 1





          works as fine for the raspberry too

          – gtatr
          Jul 11 '18 at 19:53






        • 1





          you, sir, are a hero. had this problem on solus and it worked like a charm.

          – cirrusio
          Jul 18 '18 at 3:16






        • 1





          @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

          – Benjamin R
          Aug 23 '18 at 8:57








        • 1





          @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

          – Benjamin R
          Aug 24 '18 at 14:35








        • 1





          @endolith Okay! See: fosslinux.com/3534/…

          – Benjamin R
          Aug 25 '18 at 11:57








        1




        1





        works as fine for the raspberry too

        – gtatr
        Jul 11 '18 at 19:53





        works as fine for the raspberry too

        – gtatr
        Jul 11 '18 at 19:53




        1




        1





        you, sir, are a hero. had this problem on solus and it worked like a charm.

        – cirrusio
        Jul 18 '18 at 3:16





        you, sir, are a hero. had this problem on solus and it worked like a charm.

        – cirrusio
        Jul 18 '18 at 3:16




        1




        1





        @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

        – Benjamin R
        Aug 23 '18 at 8:57







        @endolith Okay, now you want to use sudo rm -rf /usr/bin/pip3 – purge that existing directory first, then install from scratch. It's a permissions problem on that directory, but it's better to reset in these circumstances I believe, you can always easily reinstall whatever packages you lose again. If that doesn't work, nuke your Python 3 install, too, then reboot.

        – Benjamin R
        Aug 23 '18 at 8:57






        1




        1





        @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

        – Benjamin R
        Aug 24 '18 at 14:35







        @endolith Hi, it depends on what your OS (and distro, if Linux) is. Let me know and I’ll try to point you in the right direction. p.s. We’ve all been in your position more times than most of us like to admit :)

        – Benjamin R
        Aug 24 '18 at 14:35






        1




        1





        @endolith Okay! See: fosslinux.com/3534/…

        – Benjamin R
        Aug 25 '18 at 11:57





        @endolith Okay! See: fosslinux.com/3534/…

        – Benjamin R
        Aug 25 '18 at 11:57













        8














        This command also works, it reinstalls the pip:



        sudo easy_install pip






        share|improve this answer



















        • 3





          That's the easiest answer!

          – Serge Stroobandt
          Aug 8 '18 at 17:16






        • 3





          Worked like a wonder on Ubuntu

          – user2849789
          Sep 9 '18 at 0:53


















        8














        This command also works, it reinstalls the pip:



        sudo easy_install pip






        share|improve this answer



















        • 3





          That's the easiest answer!

          – Serge Stroobandt
          Aug 8 '18 at 17:16






        • 3





          Worked like a wonder on Ubuntu

          – user2849789
          Sep 9 '18 at 0:53
















        8












        8








        8







        This command also works, it reinstalls the pip:



        sudo easy_install pip






        share|improve this answer













        This command also works, it reinstalls the pip:



        sudo easy_install pip







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jul 10 '18 at 14:39









        Carlos DutraCarlos Dutra

        11114




        11114








        • 3





          That's the easiest answer!

          – Serge Stroobandt
          Aug 8 '18 at 17:16






        • 3





          Worked like a wonder on Ubuntu

          – user2849789
          Sep 9 '18 at 0:53
















        • 3





          That's the easiest answer!

          – Serge Stroobandt
          Aug 8 '18 at 17:16






        • 3





          Worked like a wonder on Ubuntu

          – user2849789
          Sep 9 '18 at 0:53










        3




        3





        That's the easiest answer!

        – Serge Stroobandt
        Aug 8 '18 at 17:16





        That's the easiest answer!

        – Serge Stroobandt
        Aug 8 '18 at 17:16




        3




        3





        Worked like a wonder on Ubuntu

        – user2849789
        Sep 9 '18 at 0:53







        Worked like a wonder on Ubuntu

        – user2849789
        Sep 9 '18 at 0:53













        2














        I got the same problem as you just now, I found the reason is that you are working without superuser privilege since some internal python packages or modules are installed under superuser privilege.



        So you can try by fist entering sudo su, then enter your password, and run pip install, it might help.






        share|improve this answer



















        • 2





          You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

          – Benjamin R
          Apr 21 '18 at 4:44






        • 1





          However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

          – Yuke
          Apr 22 '18 at 5:21








        • 2





          Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

          – Yuke
          Apr 22 '18 at 5:36













        • My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

          – Benjamin R
          Apr 23 '18 at 7:34











        • Hmmm askubuntu.com/a/802594/5032

          – endolith
          Aug 21 '18 at 10:40
















        2














        I got the same problem as you just now, I found the reason is that you are working without superuser privilege since some internal python packages or modules are installed under superuser privilege.



        So you can try by fist entering sudo su, then enter your password, and run pip install, it might help.






        share|improve this answer



















        • 2





          You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

          – Benjamin R
          Apr 21 '18 at 4:44






        • 1





          However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

          – Yuke
          Apr 22 '18 at 5:21








        • 2





          Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

          – Yuke
          Apr 22 '18 at 5:36













        • My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

          – Benjamin R
          Apr 23 '18 at 7:34











        • Hmmm askubuntu.com/a/802594/5032

          – endolith
          Aug 21 '18 at 10:40














        2












        2








        2







        I got the same problem as you just now, I found the reason is that you are working without superuser privilege since some internal python packages or modules are installed under superuser privilege.



        So you can try by fist entering sudo su, then enter your password, and run pip install, it might help.






        share|improve this answer













        I got the same problem as you just now, I found the reason is that you are working without superuser privilege since some internal python packages or modules are installed under superuser privilege.



        So you can try by fist entering sudo su, then enter your password, and run pip install, it might help.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 16 '18 at 3:34









        YukeYuke

        312




        312








        • 2





          You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

          – Benjamin R
          Apr 21 '18 at 4:44






        • 1





          However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

          – Yuke
          Apr 22 '18 at 5:21








        • 2





          Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

          – Yuke
          Apr 22 '18 at 5:36













        • My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

          – Benjamin R
          Apr 23 '18 at 7:34











        • Hmmm askubuntu.com/a/802594/5032

          – endolith
          Aug 21 '18 at 10:40














        • 2





          You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

          – Benjamin R
          Apr 21 '18 at 4:44






        • 1





          However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

          – Yuke
          Apr 22 '18 at 5:21








        • 2





          Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

          – Yuke
          Apr 22 '18 at 5:36













        • My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

          – Benjamin R
          Apr 23 '18 at 7:34











        • Hmmm askubuntu.com/a/802594/5032

          – endolith
          Aug 21 '18 at 10:40








        2




        2





        You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

        – Benjamin R
        Apr 21 '18 at 4:44





        You should never, ever need to run pip with elevated permissions. Use --user flag instead, as in: pip3 install --user <package>

        – Benjamin R
        Apr 21 '18 at 4:44




        1




        1





        However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

        – Yuke
        Apr 22 '18 at 5:21







        However, when I run without superuser permission, I still got the information like pip3 install --user Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module>\ from pip._internal import main ImportError: No module named 'pip._internal' Could you please help me to figure out why this always happen?

        – Yuke
        Apr 22 '18 at 5:21






        2




        2





        Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

        – Yuke
        Apr 22 '18 at 5:36







        Ok, I found out why, if from pip._internal import main error happen, in my solution, 1) curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 2) python3 get-pip.py --user --force-reinstall, and then you can run pip without superuser permission, Thank you very much for your advice, it helps a lot !

        – Yuke
        Apr 22 '18 at 5:36















        My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

        – Benjamin R
        Apr 23 '18 at 7:34





        My pleasure! Look, I learned the hard way to be careful about using sudo willy-nilly (destroyed my OS multiple times!)

        – Benjamin R
        Apr 23 '18 at 7:34













        Hmmm askubuntu.com/a/802594/5032

        – endolith
        Aug 21 '18 at 10:40





        Hmmm askubuntu.com/a/802594/5032

        – endolith
        Aug 21 '18 at 10:40











        1














        Apply these three steps:




        1. Go to /usr/local/bin by terminal

        2. Execute sudo gedit pip

        3. Change the from pip._internal import main into from pip import main.






        share|improve this answer






























          1














          Apply these three steps:




          1. Go to /usr/local/bin by terminal

          2. Execute sudo gedit pip

          3. Change the from pip._internal import main into from pip import main.






          share|improve this answer




























            1












            1








            1







            Apply these three steps:




            1. Go to /usr/local/bin by terminal

            2. Execute sudo gedit pip

            3. Change the from pip._internal import main into from pip import main.






            share|improve this answer















            Apply these three steps:




            1. Go to /usr/local/bin by terminal

            2. Execute sudo gedit pip

            3. Change the from pip._internal import main into from pip import main.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 13 at 6:10









            zx485

            1,47131115




            1,47131115










            answered Feb 13 at 0:40









            Sayan DeSayan De

            111




            111























                0














                The pip version now is 19.0.1:



                which pip3
                #/home/xxx/.local/bin/pip3
                vim /home/xxx/.local/bin/pip3


                Change from pip._internal import main into from pip import main






                share|improve this answer




























                  0














                  The pip version now is 19.0.1:



                  which pip3
                  #/home/xxx/.local/bin/pip3
                  vim /home/xxx/.local/bin/pip3


                  Change from pip._internal import main into from pip import main






                  share|improve this answer


























                    0












                    0








                    0







                    The pip version now is 19.0.1:



                    which pip3
                    #/home/xxx/.local/bin/pip3
                    vim /home/xxx/.local/bin/pip3


                    Change from pip._internal import main into from pip import main






                    share|improve this answer













                    The pip version now is 19.0.1:



                    which pip3
                    #/home/xxx/.local/bin/pip3
                    vim /home/xxx/.local/bin/pip3


                    Change from pip._internal import main into from pip import main







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 17 at 15:50









                    Alan LauAlan Lau

                    1




                    1























                        0














                        I solved this by updating pip via Python, like this:



                        python2 -m pip install --user --upgrade pip



                        python3 -m pip install --user --upgrade pip






                        share|improve this answer




























                          0














                          I solved this by updating pip via Python, like this:



                          python2 -m pip install --user --upgrade pip



                          python3 -m pip install --user --upgrade pip






                          share|improve this answer


























                            0












                            0








                            0







                            I solved this by updating pip via Python, like this:



                            python2 -m pip install --user --upgrade pip



                            python3 -m pip install --user --upgrade pip






                            share|improve this answer













                            I solved this by updating pip via Python, like this:



                            python2 -m pip install --user --upgrade pip



                            python3 -m pip install --user --upgrade pip







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 20 mins ago









                            Carlos DutraCarlos Dutra

                            11114




                            11114






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1025189%2fpip-is-not-working-importerror-no-module-named-pip-internal%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                                Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                                Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...