首页 > 解决方案 > 无法安装 matplotlib,因为“六”是 distutils

问题描述

我想matplotlib在我的新 Mac 上安装,但由于six是“distutils 安装项目”而无法安装,这是什么意思?我输入了以下内容:

sudo -H python -m pip install -U matplotlib

它首先抛出了“缓存这个;下载那个”的所有常用术语,然后,BOOM 就在那里;错误:

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.

标签: pythonbashunixmatplotlib

解决方案


为了了解您在这里遇到的错误,您需要了解 distutils 是什么;简而言之,它们是分发和安装 Python 扩展和包的方法。您可以在此处了解有关它们的更多信息。six是一种包装 Python 2 和 3 之间差异的方法。

话虽如此,您可以简单地添加--ignore-installed到您的参数中,如下所示。

sudo -H python -m pip install -U matplotlib --ignore-installed

推荐阅读