我试图从anaconda更新或安装新包,最近,这条消息出现了:

The environment is inconsistent, please check the package plan carefully
The following package are causing the inconsistency:

   - defaults/win-32::anaconda==5.3.1=py37_0

done

我尝试用conda clean -all,然后用conda update -all,但它仍然存在。

第二次信息

active environment : base
    active env location : C:\Users\NAME\Continuum
            shell level : 1
       user config file : C:\Users\NAME\.condarc
 populated config files : C:\Users\NAME\.condarc
          conda version : 4.6.11
    conda-build version : 3.17.7
         python version : 3.7.3.final.0
       base environment : C:\Users\NAME\Continuum  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-32
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-32
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-32
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-32
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\NAME\Continuum\pkgs
                          C:\Users\NAME\.conda\pkgs
                          C:\Users\NAME\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\NAME\Continuum\envs
                          C:\Users\NAME\.conda\envs
                          C:\Users\NAME\AppData\Local\conda\conda\envs
               platform : win-32
             user-agent : conda/4.6.11 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.17763
          administrator : False
             netrc file : None
           offline mode : False

当前回答

在我的环境中。

1.

conda install anaconda
conda update --all

然后它就可以正常工作了。

其他回答

对我有效的是

`conda remove <offending_packagename>`, 
`conda update --all` 

最后

`conda install <offending_packagename>`.

我也遇到过同样的问题。简单地运行

conda install anaconda

帮我解决了问题。

在谷歌Groups上看到的

此消息是在conda 4.6.9中添加的,以前conda检测到不一致的环境时没有指示,除非conda在调试模式下运行。很可能您的环境在一段时间内不一致,但升级到conda使其可见。对于不一致的包,最好执行“conda install package_name”命令,让conda尝试恢复一致性。

这对我来说真的很管用。

也许你应该试试在你的情况下安装anaconda。

在我的案例中,上述方法都不奏效。但这不到一分钟就奏效了:

1-我再次下载了最新的安装程序(在我的情况下是miniconda)

2-使用-u选项运行安装程序:

bash Miniconda3-py39_xxxx-Linux-x86_64.sh -u

3-对所有问题回答“是”,让安装程序完成

4-然后运行conda update conda -all

希望这对你有所帮助……

假设有如下情况,

> conda update -c intel --all
Collecting package metadata: done
Solving environment: |
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - intel/win-64::ipython==6.3.1=py36_3
  - intel/win-64::prompt_toolkit==1.0.15=py36_2
done

正如在其他回答中提到的,其思想是对不一致的包进行某种重新安装。

因此,通过一些复制-粘贴,你可以:

> conda install intel/win-64::ipython==6.3.1=py36_3
Collecting package metadata: done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - intel/win-64::ipython==6.3.1=py36_3
  - intel/win-64::prompt_toolkit==1.0.15=py36_2
done

## Package Plan ##

  environment location: c:\conda

  added / updated specs:
    - ipython


The following NEW packages will be INSTALLED:

  jedi               intel/win-64::jedi-0.12.0-py36_2
  parso              intel/win-64::parso-0.2.0-py36_2
  pygments           intel/win-64::pygments-2.2.0-py36_5
  wcwidth            intel/win-64::wcwidth-0.1.7-py36_6


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(你将不得不重复所有的包)


我的“快捷方式”

或者,编写一个(丑陋的)一行程序(这应该适用于Windows和其他平台)

注意:通过“ORIGINAL_COMMAND”,我指的是给您错误消息的任何命令(理想情况下没有任何其他副作用)

<ORIGINAL_COMMAND> 2>&1 | python -c "import sys,re,conda.cli; conda.cli.main('conda','install','-y',*re.findall(r'^\s*-\s*(\S+)$',sys.stdin.read(),re.MULTILINE))"

展开上面的一行代码:

from re import findall, MULTILINE
from sys import stdin
from conda.cli import main

main(
    "conda", "install", "-y",
    "--force",  # Maybe add a '--force'/'--force-reinstall' (I didn't add it for the one-liner above)
    *findall(r"^\s*-\s*(\S+)$", stdin.read(), MULTILINE)  # Here are the offenders
)