Python:在 pip install tld 时无法卸载“六”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/50954182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 19:39:33  来源:igfitidea点击:

Python: Cannot uninstall 'six' while pip install tld

pythontldsix

提问by D09r

$ 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.

When installing tld module getting error of cannot uninstall existing 'six' module.

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

回答by D09r

$ 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.

If you're getting above error, then try the following command to install six-1.11.0 and tld-0.9.

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

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

$ pip install tld --ignore-installed 6 --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

回答by suresh Palemoni

Use: pip install tld --ignore-installed six

用: pip install tld --ignore-installed six

回答by Daniel Cavenago

I had the same issue installing pytest... seems is related to mojave osx... I′ve fixed it by doing:

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

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