ImportError: cannot import name main when running pip --version command in windows7 32 bit

后端 未结 16 1416
余生分开走
余生分开走 2020-11-28 01:28

I\'ve installed the latest python (2.7.9) bundled with pip and setuptools for windows 32-bit. I\'ve tried reinstalling pip but the problem persists.

Here\'s the erro

相关标签:
16条回答
  • 2020-11-28 02:09

    If you have a hardlink to pip in your PATH (i.e. if you have multiple python versions installed) and then you upgrade pip, you may also encounter this error.

    The solution consists in creating the hardlink again. Or even better, stop using hardlinks and use softlinks.

    0 讨论(0)
  • 2020-11-28 02:11

    i fixed the problem by reinstalling pip using get-pip.py.

    1. Download get-pip from official link: https://pip.pypa.io/en/stable/installing/#upgrading-pip
    2. run it using commande: python get-pip.py.

    And pip is fixed and work perfectly.

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

    This solved my problem in ubuntu 18.04 when trying to use python3.6:

    rm -rf ~/.local/lib/python3.6
    

    You can move the folder to another place using mv instead of deleting it too, for testing:

    mv ~/.local/lib/python3.6 ./python3.6_old
    
    0 讨论(0)
  • 2020-11-28 02:15

    I had the same problem, but uninstall and reinstall with apt and pip didn't work for me.

    I saw another solution that presents a easy way to recover pip3 path:

    sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
    
    0 讨论(0)
提交回复
热议问题