The 'pip==7.1.0' distribution was not found and is required by the application

前端 未结 10 1038
故里飘歌
故里飘歌 2020-12-02 20:15

I have the latest version of pip 8.1.1 on my ubuntu 16. But I am not able to install any modules via pip as I get this error all the time.

File \"/usr/local/         


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

    After upgrading from 18.0 to 18.1, I got the same error. Reinstalling the program(without using pip itself) worked for me:

    $ curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
    $ sudo python get-pip.py
    
    0 讨论(0)
  • 2020-12-02 20:29

    I repaired mine this with command:

    easy_install pip

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

    Delete all of the pip/pip3 stuff under .local including the packages.

    sudo apt-get purge python-pip python3-pip
    

    Now remove all pip3 files from local

    sudo rm -rf /usr/local/bin/pip3
    

    you can check which pip is installed other wise execute below one to remove all (No worries)

    sudo rm -rf /usr/local/bin/pip3.*
    

    Using pip and/or pip3, reinstall needed Python packages.

    sudo apt-get install python-pip python3-pip
    
    0 讨论(0)
  • 2020-12-02 20:34

    I did not manage to get it to work by using easy_install pip or updating the pip configuration file /usr/local/bin/pip.

    Instead, I removed pip and installed the distribution required by the conf file:

    Uninstalling pip:

    $ sudo apt purge python-pip or $ sudo yum remove python-pip

    Reinstalling required distribution of pip (change the distribution accordingly):

    $ sudo easy_install pip==9.0.3

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

    On mac this can be fixed with brew

    brew reinstall python
    
    0 讨论(0)
  • 2020-12-02 20:35

    I had this issue for a very long time until I recently found that my 'pip' file (/usr/local/bin/pip) is trying to load the wrong version of pip. I believe you also have 8.1.1 correctly installed on your machine and can give following a try.

    1. Open your /usr/local/bin/pip file. For me it looks like :

      __requires__ = 'pip==9.0.1'
      import sys
      from pkg_resources import load_entry_point
      if __name__ == '__main__':
          sys.exit(
              load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
      )
      
    2. Change 'pip==9.0.1' in line 1 and last line to whichever version you have installed on your system, for example you will need to change 7.1.0 to 8.1.1.

    Basically /usr/local/bin/pip is an entry file for loading the pip required version module. Somehow when I am upgrading/changing pip installation this file is not getting updated and so I update it manually every time.

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