Latest 'pip' fails with “requires setuptools >= 0.8 for dist-info”

后端 未结 2 1774
孤街浪徒
孤街浪徒 2020-12-02 06:45

Using the recent (1.5) version of pip, I get an error when attempting to update several packages. For example, sudo pip install -U pytz results in

相关标签:
2条回答
  • 2020-12-02 07:33

    This worked for me:

    sudo pip install setuptools --no-use-wheel --upgrade
    

    Note it's usage of sudo

    UPDATE

    On window you just need to execute pip install setuptools --no-use-wheel --upgrade as an administrator. In unix/linux, sudo command is for elevating permissions.

    UPDATE

    This appears to have been fixed in 1.5.1.

    0 讨论(0)
  • 2020-12-02 07:37

    First, you should never run 'sudo pip'.

    If possible you should use your system package manager because it uses GPG signatures to ensure you're not running malicious code.

    Otherwise, try upgrading setuptools:

    easy_install -U setuptools
    

    Alternatively, try:

    pip install --user <somepackage>
    

    This is of course for "global" packages. You should ideally be using virtualenvs.

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