DistributionNotFound error after upgrading pip

后端 未结 8 1912
借酒劲吻你
借酒劲吻你 2020-12-31 12:59

In reading about virtualenv here I realized I didn\'t have pip 1.3+, so I ran pip install --upgrade pip and now when I run pip --version i get the

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 13:26

    As an aside, there's an easier way to do it (I just encountered this).

    Edit /usr/local/bin/pip and change the references to version number (so below you'd want to change '1.5.6' to whatever version number you're using):

    #!/usr/local/opt/python/bin/python2.7
    # EASY-INSTALL-ENTRY-SCRIPT: 'pip==1.5.6','console_scripts','pip'
    __requires__ = 'pip==1.5.6'
    import sys
    from pkg_resources import load_entry_point
    
    if __name__ == '__main__':
        sys.exit(
            load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
        )
    

    then you may be completely good at that point.

提交回复
热议问题