{"action":"created","issue":{"url":"https://api.github.com/repos/conda/conda/issues/1967","repository_url":"https://api.github.com/repos/conda/conda","labels_url":"https://api.github.com/repos/conda/conda/issues/1967/labels{/name}","comments_url":"https://api.github.com/repos/conda/conda/issues/1967/comments","events_url":"https://api.github.com/repos/conda/conda/issues/1967/events","html_url":"https://github.com/conda/conda/issues/1967","id":127468477,"number":1967,"title":"conda \"update\" and \"install\" commands can leave an environment with inconsistent dependencies","user":{"login":"seibert","id":425352,"avatar_url":"https://avatars.githubusercontent.com/u/425352?v=3","gravatar_id":"","url":"https://api.github.com/users/seibert","html_url":"https://github.com/seibert","followers_url":"https://api.github.com/users/seibert/followers","following_url":"https://api.github.com/users/seibert/following{/other_user}","gists_url":"https://api.github.com/users/seibert/gists{/gist_id}","starred_url":"https://api.github.com/users/seibert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seibert/subscriptions","organizations_url":"https://api.github.com/users/seibert/orgs","repos_url":"https://api.github.com/users/seibert/repos","events_url":"https://api.github.com/users/seibert/events{/privacy}","received_events_url":"https://api.github.com/users/seibert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":44,"created_at":"2016-01-19T15:18:02Z","updated_at":"2016-03-03T10:44:04Z","closed_at":null,"body":"There have been a number of issues reporting various kinds of behavior which I think all has the same root cause.  The dependency resolution when running \"conda install\" and \"conda update\" does not appear to take the other packages in the environment into question.  This can result quite easily in an environment being updated to a state where the package dependencies are not actually met.\r\n\r\nFor example, let's suppose I create an environment with pandas and h5py, but with NumPy 1.9 initially (let's imagine NumPy 1.10 hasn't been released yet)\r\n```\r\nRover:~ stan$ conda create -n dep_test python=3.4 h5py pandas numpy=1.9\r\nFetching package metadata: ....\r\nSolving package specifications: ...................\r\nPackage plan for installation in environment /Users/stan/anaconda/envs/dep_test:\r\n\r\nThe following NEW packages will be INSTALLED:\r\n\r\n    h5py:            2.5.0-np19py34_3\r\n    hdf5:            1.8.15.1-2\r\n    numpy:           1.9.3-py34_0\r\n    openssl:         1.0.2e-0\r\n    pandas:          0.16.2-np19py34_0\r\n    pip:             7.1.2-py34_0\r\n    python:          3.4.4-0\r\n    python-dateutil: 2.4.2-py34_0\r\n    pytz:            2015.7-py34_0\r\n    readline:        6.2-2\r\n    setuptools:      19.2-py34_0\r\n    six:             1.10.0-py34_0\r\n    sqlite:          3.9.2-0\r\n    tk:              8.5.18-0\r\n    wheel:           0.26.0-py34_1\r\n    xz:              5.0.5-0\r\n    zlib:            1.2.8-0\r\n\r\nProceed ([y]/n)? y\r\n\r\nLinking packages ...\r\n[      COMPLETE      ]|###################################################| 100%\r\n#\r\n# To activate this environment, use:\r\n# $ source activate dep_test\r\n#\r\n# To deactivate this environment, use:\r\n# $ source deactivate\r\n#\r\n```\r\nEverything is fine and consistent.\r\n\r\nNow, some time in the future, let's suppose I try to upgrade pandas:\r\n```\r\nRover:~ stan$ conda update -n dep_test pandas\r\nFetching package metadata: ....\r\nSolving package specifications: ..................\r\nPackage plan for installation in environment /Users/stan/anaconda/envs/dep_test:\r\n\r\nThe following packages will be UPDATED:\r\n\r\n    numpy:  1.9.3-py34_0      --> 1.10.2-py34_0\r\n    pandas: 0.16.2-np19py34_0 --> 0.17.1-np110py34_0\r\n\r\nProceed ([y]/n)? y\r\n\r\nUnlinking packages ...\r\n[      COMPLETE      ]|###################################################| 100%\r\nLinking packages ...\r\n[      COMPLETE      ]|###################################################| 100%\r\n```\r\n\r\nNow I have an h5py package that requires NumPy 1.9 installed at the same time as a pandas package that requires NumPy 1.10:\r\n```\r\nRover:~ stan$ conda list -n dep_test pandas\r\n# packages in environment at /Users/stan/anaconda/envs/dep_test:\r\n#\r\npandas                    0.17.1              np110py34_0\r\nRover:~ stan$ conda list -n dep_test h5py\r\n# packages in environment at /Users/stan/anaconda/envs/dep_test:\r\n#\r\nh5py                      2.5.0                np19py34_3\r\n```\r\n\r\nI've seen this behavior in a bunch of different (not specifically NumPy) related situations, leading me to conclude that (for speed reasons?) the dependency solver is not considering *all* of the already-installed packages when creating an install plan for an `upgrade` operation, only those in the dependency tree rooted in the packages explicitly listed on the command line.\r\n\r\n(This issue probably duplicates other issues, but I haven't seen one that explains the problem generically.)"},"comment":{"url":"https://api.github.com/repos/conda/conda/issues/comments/191702733","html_url":"https://github.com/conda/conda/issues/1967#issuecomment-191702733","issue_url":"https://api.github.com/repos/conda/conda/issues/1967","id":191702733,"user":{"login":"megies","id":1842780,"avatar_url":"https://avatars.githubusercontent.com/u/1842780?v=3","gravatar_id":"","url":"https://api.github.com/users/megies","html_url":"https://github.com/megies","followers_url":"https://api.github.com/users/megies/followers","following_url":"https://api.github.com/users/megies/following{/other_user}","gists_url":"https://api.github.com/users/megies/gists{/gist_id}","starred_url":"https://api.github.com/users/megies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/megies/subscriptions","organizations_url":"https://api.github.com/users/megies/orgs","repos_url":"https://api.github.com/users/megies/repos","events_url":"https://api.github.com/users/megies/events{/privacy}","received_events_url":"https://api.github.com/users/megies/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T10:44:04Z","updated_at":"2016-03-03T10:44:04Z","body":"OK, I've updated to bleeding edge `conda` version served through `conda` channel. Now getting an Exception when trying to check out what `conda remove numpy` is trying to do:\r\n```\r\n~$ conda remove numpy\r\nFetching package metadata: ........\r\nSolving package specifications: ...........\r\nAn unexpected error has occurred, please consider sending the\r\nfollowing traceback to the conda GitHub issue tracker at:\r\n\r\n    https://github.com/conda/conda/issues\r\n\r\nInclude the output of the command 'conda info' in your report.\r\n\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/megies/anaconda/bin/conda\", line 6, in <module>\r\n    sys.exit(conda.cli.main())\r\n  File \"/home/megies/anaconda/lib/python2.7/site-packages/conda/cli/main.py\", line 139, in main\r\n    args_func(args, p)\r\n  File \"/home/megies/anaconda/lib/python2.7/site-packages/conda/cli/main.py\", line 146, in args_func\r\n    args.func(args, p)\r\n  File \"/home/megies/anaconda/lib/python2.7/site-packages/conda/cli/main_remove.py\", line 157, in execute\r\n    actions = plan.remove_actions(prefix, specs, index=index, pinned=args.pinned)\r\n  File \"/home/megies/anaconda/lib/python2.7/site-packages/conda/plan.py\", line 475, in remove_actions\r\n    if pinned and any(r.match(ms, dist) for ms in pinned_specs):\r\n  File \"/home/megies/anaconda/lib/python2.7/site-packages/conda/plan.py\", line 475, in <genexpr>\r\n    if pinned and any(r.match(ms, dist) for ms in pinned_specs):\r\n  File \"/home/megies/anaconda/lib/python2.7/site-packages/conda/resolve.py\", line 511, in match\r\n    return ms.match(self.index[fn])\r\nAttributeError: 'str' object has no attribute 'match'\r\n~$ conda info\r\nCurrent conda install:\r\n\r\n             platform : linux-64\r\n        conda version : 3.19.3.dev214+g57e4dd8\r\n  conda-build version : 1.19.0\r\n       python version : 2.7.11.final.0\r\n     requests version : 2.9.1\r\n     root environment : /home/megies/anaconda  (writable)\r\n  default environment : /home/megies/anaconda\r\n     envs directories : /home/megies/anaconda/envs\r\n        package cache : /home/megies/anaconda/pkgs\r\n         channel URLs : https://conda.anaconda.org/conda/linux-64/\r\n                        https://conda.anaconda.org/conda/noarch/\r\n                        https://conda.anaconda.org/obspy/linux-64/\r\n                        https://conda.anaconda.org/obspy/noarch/\r\n                        https://repo.continuum.io/pkgs/free/linux-64/\r\n                        https://repo.continuum.io/pkgs/free/noarch/\r\n                        https://repo.continuum.io/pkgs/pro/linux-64/\r\n                        https://repo.continuum.io/pkgs/pro/noarch/\r\n          config file : /home/megies/.condarc\r\n    is foreign system : False\r\n```"}}