为什么 matplotlib 在 Anaconda 中没有更新到 2.0 版本

Why matplotlib doesn't update in Anaconda to the 2.0 version

我最近试图更新我所有的 Anaconda 包:

conda update conda
conda update anaconda

有些还没有更新,所以我也更新了conda update --all。 现在我的 conda version : 4.3.16,这似乎是最新版本。但是,由于某些原因,matplotlib 仍然有旧版本:

conda list
matplotlib                1.5.1               np111py35_0 

根据Anaconda changelog,应该更新到2.0版本:matplotlib from 1.5.3 to 2.0.0。 如果这很重要,我安装的 python 版本是 3.5.2

UPD:似乎 spyder-app 由于依赖项问题而阻止更新:

 conda install anaconda=4.3.1
UnsatisfiableError: The following specifications were found to be in conflict:
  - anaconda 4.3.1* -> spyder 3.1.2 py34_0
  - spyder-app -> spyder 2.3.3
Use "conda info <package>" to see the dependencies for each package.

conda install matplotlib=2
UnsatisfiableError: The following specifications were found to be in conflict:
 - matplotlib 2.0*
 - spyder-app -> spyder 2.3.0 -> pyqt 4.* -> qt >=4.8.6,<5.0
 - spyder-app -> spyder 2.3.0 -> pyqt 4.* -> sip >=4.16.4,<4.18
 Use "conda info <package>" to see the dependencies for each package.

UPD2:问题已通过删除 spyder-app 解决:

conda remove spyder-app
conda update anaconda

Matlotlib 已更新至 2.0 版本,以及其他更新包。我还检查了 Spyder IDE 是否仍然有效,并且它仍然能够 运行.

可能是依赖冲突。 anaconda 包只是一个捆绑包的元包,如果某些包由于您安装的包而无法更新(可能需要 matplotlib < 2,或者甚至间接地要求包和版本matplotlib 取决于)那么你可能无法安装最新版本的 anaconda 包。您可以尝试自己安装最新的 anaconda 软件包(目前是 4.3.1):

conda install anaconda=4.3.1

但你也可以尝试手动安装特定版本的matplotlib,看看会发生什么(如果因为依赖关系无法安装,应该会有提示信息):

conda install matplotlib=2

在你的情况下,是 spyder-app 负责。这是一个已弃用的软件包,未包含在较新版本的 anaconda 中,因此一种可能性是将其删除:

conda remove spyder-app

然后尝试更新 anacondamatplotlib

另一种方法是创建一个新环境,然后您可以选择在以下情况下使用哪个环境:

conda install -n mynewenvironment python=3.5 anaconda

然后在需要时使用新环境 matplotlib 2 如果需要 spyder-app 则使用旧环境(并且不关心 matplotlib 版本)。