【问题标题】:Python: Cannot uninstall 'six' while pip install tldPython:在 pip install tld 时无法卸载“六”
【发布时间】:2018-11-29 22:32:16
【问题描述】:
$ pip install tld
Collecting tld
  Using cached https://files.pythonhosted.org/packages/fa/78/dbeaeb20db795c42deb81271fd65a35c040ce2e946024eaeef5c6b184176/tld-0.9-py2.py3-none-any.whl
Collecting six>=1.9 (from tld)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, tld
  Found existing installation: six 1.4.1
Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

安装 tld 模块时出现无法卸载现有“六”模块的错误。

【问题讨论】:

    标签: python tld six


    【解决方案1】:
    $ pip install tld
    Collecting tld
      Using cached https://files.pythonhosted.org/packages/fa/78/dbeaeb20db795c42deb81271fd65a35c040ce2e946024eaeef5c6b184176/tld-0.9-py2.py3-none-any.whl
    Collecting six>=1.9 (from tld)
      Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
    Installing collected packages: six, tld
      Found existing installation: six 1.4.1
    Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
    

    如果您遇到上述错误,请尝试以下命令安装 6-1.11.0 和 tld-0.9。

    $ pip install tld --ignore-installed 六 --user

    $ pip install tld --ignore-installed six --user
    Collecting tld
      Using cached https://files.pythonhosted.org/packages/fa/78/dbeaeb20db795c42deb81271fd65a35c040ce2e946024eaeef5c6b184176/tld-0.9-py2.py3-none-any.whl
    Collecting six
      Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
    Installing collected packages: six, tld
    Successfully installed six-1.11.0 tld-0.9
    

    【讨论】:

      【解决方案2】:

      使用:pip install tld --ignore-installed six

      【讨论】:

        【解决方案3】:

        我在安装 pytest 时遇到了同样的问题...似乎与 mojave osx 有关...我已经通过以下方式修复了它:

        • 酿造更新
        • sudo 安装程序 -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
        • brew 重新安装 python@2

        【讨论】:

        • 升级 python 2.7.16 为我在 Mojave 解决了这个问题,谢谢。
        • 这应该是 MacOs 用户的首选答案
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-10-03
        • 2020-03-28
        • 1970-01-01
        • 2015-08-17
        • 2021-07-30
        • 1970-01-01
        • 2020-06-30
        相关资源
        最近更新 更多