Repository: conda/conda

Issue:
Upgrading from conda 4.3 to 4.4 with certain dependency specifications in conda's history can lead to a broken conda
Conda updated itself from 4.3 to 4.4. Since then, my conda installation appears to be broken. I now get the following for many conda operations (e.g. `conda update conda`, `conda install numpy`, etc):

```
Solving environment: failed

CondaValueError: Invalid MatchSpec: <2.0
```

More info...

```
$ conda --version
conda 4.4.7
$ conda install -vvv numpy
DEBUG conda.gateways.logging:set_verbosity(148): verbosity set to 3
Solving environment: ...working... DEBUG conda.core.solve:solve_final_state(140): solving prefix /scratch/mc3
  specs_to_remove: frozenset()
  specs_to_add: frozenset({MatchSpec(name=LowerStrMatch('numpy'))})
  prune: False
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/appnope-0.1.0-py36hf537a9a_0.json
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/asn1crypto-0.23.0-py36h782d450_0.json
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/bleach-2.1.1-py36h27c13d8_0.json
[...]
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/zeromq-4.2.2-ha360ad0_2.json
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/zlib-1.2.11-hf3cbc9b_2.json
failed
Traceback (most recent call last):
  File "/scratch/mc3/lib/python3.6/site-packages/conda/exceptions.py", line 743, in __call__
    return func(*args, **kwargs)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
    install(args, parser, 'install')
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
    force_reinstall=context.force,
  File "/scratch/mc3/lib/python3.6/site-packages/conda/core/solve.py", line 504, in solve_for_transaction
    force_remove, force_reinstall)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/core/solve.py", line 437, in solve_for_diff
    final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/core/solve.py", line 146, in solve_final_state
    specs_from_history_map = History(self.prefix).get_requested_specs_map()
  File "/scratch/mc3/lib/python3.6/site-packages/conda/history.py", line 187, in get_requested_specs_map
    spec_map.update(((s.name, s) for s in update_specs))
  File "/scratch/mc3/lib/python3.6/site-packages/conda/history.py", line 187, in <genexpr>
    spec_map.update(((s.name, s) for s in update_specs))
  File "/scratch/mc3/lib/python3.6/site-packages/conda/history.py", line 186, in <genexpr>
    update_specs = (MatchSpec(spec) for spec in request.get('update_specs', ()))
  File "/scratch/mc3/lib/python3.6/site-packages/conda/models/match_spec.py", line 39, in __call__
    parsed = _parse_spec_str(spec_arg)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/models/match_spec.py", line 556, in _parse_spec_str
    raise CondaValueError("Invalid MatchSpec: %s" % spec_str)
conda.exceptions.CondaValueError: Invalid MatchSpec: <2.0
```
Upgrading from conda 4.3 to 4.4 with certain dependency specifications in conda's history can lead to a broken conda
Conda updated itself from 4.3 to 4.4. Since then, my conda installation appears to be broken. I now get the following for many conda operations (e.g. `conda update conda`, `conda install numpy`, etc):

```
Solving environment: failed

CondaValueError: Invalid MatchSpec: <2.0
```

More info...

```
$ conda --version
conda 4.4.7
$ conda install -vvv numpy
DEBUG conda.gateways.logging:set_verbosity(148): verbosity set to 3
Solving environment: ...working... DEBUG conda.core.solve:solve_final_state(140): solving prefix /scratch/mc3
  specs_to_remove: frozenset()
  specs_to_add: frozenset({MatchSpec(name=LowerStrMatch('numpy'))})
  prune: False
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/appnope-0.1.0-py36hf537a9a_0.json
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/asn1crypto-0.23.0-py36h782d450_0.json
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/bleach-2.1.1-py36h27c13d8_0.json
[...]
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/zeromq-4.2.2-ha360ad0_2.json
TRACE conda.core.linked_data:_load_single_record(113): loading prefix record /scratch/mc3/conda-meta/zlib-1.2.11-hf3cbc9b_2.json
failed
Traceback (most recent call last):
  File "/scratch/mc3/lib/python3.6/site-packages/conda/exceptions.py", line 743, in __call__
    return func(*args, **kwargs)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
    exit_code = do_call(args, p)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 76, in do_call
    exit_code = getattr(module, func_name)(args, parser)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
    install(args, parser, 'install')
  File "/scratch/mc3/lib/python3.6/site-packages/conda/cli/install.py", line 236, in install
    force_reinstall=context.force,
  File "/scratch/mc3/lib/python3.6/site-packages/conda/core/solve.py", line 504, in solve_for_transaction
    force_remove, force_reinstall)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/core/solve.py", line 437, in solve_for_diff
    final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/core/solve.py", line 146, in solve_final_state
    specs_from_history_map = History(self.prefix).get_requested_specs_map()
  File "/scratch/mc3/lib/python3.6/site-packages/conda/history.py", line 187, in get_requested_specs_map
    spec_map.update(((s.name, s) for s in update_specs))
  File "/scratch/mc3/lib/python3.6/site-packages/conda/history.py", line 187, in <genexpr>
    spec_map.update(((s.name, s) for s in update_specs))
  File "/scratch/mc3/lib/python3.6/site-packages/conda/history.py", line 186, in <genexpr>
    update_specs = (MatchSpec(spec) for spec in request.get('update_specs', ()))
  File "/scratch/mc3/lib/python3.6/site-packages/conda/models/match_spec.py", line 39, in __call__
    parsed = _parse_spec_str(spec_arg)
  File "/scratch/mc3/lib/python3.6/site-packages/conda/models/match_spec.py", line 556, in _parse_spec_str
    raise CondaValueError("Invalid MatchSpec: %s" % spec_str)
conda.exceptions.CondaValueError: Invalid MatchSpec: <2.0
```


Discussion:
Can you either attach here or email to me (kfranz at anaconda com) the file

    /scratch/mc3/conda-meta/history
@nehaljwani figured out the problem, and the fix to get me up and running again was very easy.

When I'd previously installed a dependency using an awkward specification, conda 4.3 wrote an entry to conda-meta/history that causes conda 4.4 to fail.

The following command
```
$ which conda
/scratch/mc3/bin/conda
$ conda --version
conda 4.3.31
$ conda install -c conda-forge "param>=1.5.1,<2.0"
```

results in the following entry in /scratch/mc3/conda-meta/history:
```
# cmd: /scratch/mc3/bin/conda install -c conda-forge param>=1.5.1,<2.0
[...]
# install specs: param >=1.5.1,<2.0
```

That entry causes no problems for conda 4.3. However, after updating to conda 4.4, there's a problem:

```
$ conda --version
conda 4.4.7
$ conda install numpy
Solving environment: failed

CondaValueError: Invalid MatchSpec: <2.0
```

Fortunately, removing the `install specs` line in /scratch/mc3/conda-meta/history makes the problem go away.

Conda 4.4 writes the history information differently (quoting the matchspec). The following command:
```
$ conda --version
conda 4.4.7
$ conda install -c conda-forge "param>=1.5.1,<2.0"
```

appears in /scratch/mc3/conda-meta/history as:
```
# cmd: /scratch/mc3/bin/conda install -c conda-forge param>=1.5.1,<2.0
[...]
# update specs: ["param[version='>=1.5.1,<2.0']"]
```
I think this is a bug that we should try to write a test for and solve.
Ah, I meant to write an issue for this one some time ago but didn't -- and didn't see this one!
Reproducers:

----

```bash
export CONDA_ALWAYS_YES=1
source bin/activate
conda --version
cconda() {  # run conda commands with concise output
    echo
    echo '>'conda "${@}"
    conda "$1" -q "${@:2}" |\
       sed -n '/INSTALLED\|UPDATED\|DOWNGRADED\|REMOVED/,${/ done$/ba;H;:a};${x;p}'
}
cconda create -nz fontconfig
source activate z
cconda remove fontconfig freetype
cd envs
cat z/conda-meta/history
mv z z-base
mkdir z

test-case() {
    printf '%99s\n' | tr ' ' =
    mkdir z-top z-work
    sudo mount -t overlay overlay -o lowerdir=z-base,upperdir=z-top,workdir=z-work z
    if [[ $# -ne 0 ]] ; then
        "${@}"
        sed -n '/^==>/{h;d};H;${x;p}' z/conda-meta/history
    fi
    cconda install --dry-run 'zlib<1.2.11'
    sudo umount z
    sudo rm -r z-top z-work
}
test-case
test-case cconda install fontconfig
test-case cconda install -f libpng libxml2
test-case cconda install -f libxml2
test-case cconda install -f libpng
test-case cconda remove libpng
test-case cconda remove libxml2

rmdir z
mv z-base z
source deactivate
cconda remove -nz --all
)
```
<details><summary>output:</summary><p>

```
conda 4.4.7

>conda create -nz fontconfig

The following NEW packages will be INSTALLED:

    fontconfig:   2.12.4-h88586e7_1
    freetype:     2.8-hab7d2ae_1
    icu:          58.2-h9c2bf20_1
    libgcc-ng:    7.2.0-h7cc24e2_2
    libpng:       1.6.34-hb9fc6fc_0
    libstdcxx-ng: 7.2.0-h7a57d05_2
    libxml2:      2.9.4-h2e8b1d7_6
    xz:           5.2.3-h55aa19d_2
    zlib:         1.2.11-ha838bed_2


>conda remove fontconfig freetype

The following packages will be REMOVED:

    fontconfig: 2.12.4-h88586e7_1
    freetype:   2.8-hab7d2ae_1

==> 2018-01-24 16:01:04 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda create -q -nz fontconfig
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-hab7d2ae_1
+defaults::icu-58.2-h9c2bf20_1
+defaults::libgcc-ng-7.2.0-h7cc24e2_2
+defaults::libpng-1.6.34-hb9fc6fc_0
+defaults::libstdcxx-ng-7.2.0-h7a57d05_2
+defaults::libxml2-2.9.4-h2e8b1d7_6
+defaults::xz-5.2.3-h55aa19d_2
+defaults::zlib-1.2.11-ha838bed_2
# update specs: ['fontconfig']
==> 2018-01-24 16:01:07 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda remove -q fontconfig freetype
-defaults::fontconfig-2.12.4-h88586e7_1
-defaults::freetype-2.8-hab7d2ae_1
# remove specs: ['freetype', 'fontconfig']
===================================================================================================

>conda install --dry-run zlib<1.2.11

UnsatisfiableError: The following specifications were found to be in conflict:
  - libxml2 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
Use "conda info <package>" to see the dependencies for each package.


===================================================================================================

>conda install fontconfig

The following NEW packages will be INSTALLED:

    fontconfig: 2.12.4-h88586e7_1
    freetype:   2.8-hab7d2ae_1

==> 2018-01-24 16:01:13 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q fontconfig
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-hab7d2ae_1
# update specs: ['fontconfig']

>conda install --dry-run zlib<1.2.11

The following NEW packages will be INSTALLED:

    libiconv:   1.15-h63c8f33_5

The following packages will be DOWNGRADED:

    fontconfig: 2.12.4-h88586e7_1 --> 2.11.1-6
    freetype:   2.8-hab7d2ae_1    --> 2.5.5-2
    libpng:     1.6.34-hb9fc6fc_0 --> 1.6.30-1
    libxml2:    2.9.4-h2e8b1d7_6  --> 2.9.4-0
    zlib:       1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda install -f libpng libxml2

The following packages will be UPDATED:

    libpng:  1.6.34-hb9fc6fc_0 --> 1.6.34-hb9fc6fc_0
    libxml2: 2.9.4-h2e8b1d7_6  --> 2.9.4-h2e8b1d7_6

==> 2018-01-24 16:01:22 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q -f libpng libxml2
# update specs: ['libpng', 'libxml2']

>conda install --dry-run zlib<1.2.11

The following NEW packages will be INSTALLED:

    libiconv: 1.15-h63c8f33_5

The following packages will be DOWNGRADED:

    libpng:   1.6.34-hb9fc6fc_0 --> 1.6.30-1
    libxml2:  2.9.4-h2e8b1d7_6  --> 2.9.4-0
    zlib:     1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda install -f libxml2

The following packages will be UPDATED:

    libxml2: 2.9.4-h2e8b1d7_6 --> 2.9.4-h2e8b1d7_6

==> 2018-01-24 16:01:28 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q -f libxml2
# update specs: ['libxml2']

>conda install --dry-run zlib<1.2.11

The following NEW packages will be INSTALLED:

    libiconv: 1.15-h63c8f33_5

The following packages will be REMOVED:

    libpng:   1.6.34-hb9fc6fc_0

The following packages will be DOWNGRADED:

    libxml2:  2.9.4-h2e8b1d7_6  --> 2.9.4-0
    zlib:     1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda install -f libpng

The following packages will be UPDATED:

    libpng: 1.6.34-hb9fc6fc_0 --> 1.6.34-hb9fc6fc_0

==> 2018-01-24 16:01:34 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q -f libpng
# update specs: ['libpng']

>conda install --dry-run zlib<1.2.11

The following packages will be REMOVED:

    libxml2: 2.9.4-h2e8b1d7_6

The following packages will be DOWNGRADED:

    libpng:  1.6.34-hb9fc6fc_0 --> 1.6.30-1
    zlib:    1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda remove libpng

The following packages will be REMOVED:

    libpng: 1.6.34-hb9fc6fc_0

==> 2018-01-24 16:01:40 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda remove -q libpng
-defaults::libpng-1.6.34-hb9fc6fc_0
# remove specs: ['libpng']

>conda install --dry-run zlib<1.2.11

The following packages will be REMOVED:

    libxml2: 2.9.4-h2e8b1d7_6

The following packages will be DOWNGRADED:

    zlib:    1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda remove libxml2

The following packages will be REMOVED:

    libxml2: 2.9.4-h2e8b1d7_6

==> 2018-01-24 16:01:46 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda remove -q libxml2
-defaults::libxml2-2.9.4-h2e8b1d7_6
# remove specs: ['libxml2']

>conda install --dry-run zlib<1.2.11

The following packages will be REMOVED:

    libpng: 1.6.34-hb9fc6fc_0

The following packages will be DOWNGRADED:

    zlib:   1.2.11-ha838bed_2 --> 1.2.8-3


>conda remove -nz --all

Remove all packages in environment /home/maba/code/conda/conda-4.4/envs/z:

```
</p></details>
[EDIT: fixed copy-pasta error]

----

```bash
_TMPDIR=$(mktemp -d) ; (
set -x
show-latest-history() { sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history ; }
try-dry-run-install() { conda install -q --dry-run 'zlib<1.2.11' ; }
export CONDA_ALWAYS_YES=1
export CONDA_AUTO_UPDATE_CONDA=0
export CONDA__AGGRESSIVE_UPDATE_PACKAGES=none
cd $_TMPDIR
bash ~/code/conda/Anaconda3-5.0.1-Linux-x86_64.sh -bfp . >/dev/null
source bin/activate 2>/dev/null
alias conda=bin/conda  # use conda directly <- less clutter with "set -x"

conda update -q conda
cat conda-meta/history
try-dry-run-install
CONDA_PINNED_PACKAGES=anaconda=custom conda install -qf anaconda
show-latest-history
try-dry-run-install
conda remove -q anaconda
show-latest-history
try-dry-run-install
conda install -q anaconda=custom
show-latest-history
try-dry-run-install
) ; rm -r $_TMPDIR
```
<details><summary>output:</summary><p>

```
+ export CONDA_ALWAYS_YES=1
+ CONDA_ALWAYS_YES=1
+ export CONDA_AUTO_UPDATE_CONDA=0
+ CONDA_AUTO_UPDATE_CONDA=0
+ export CONDA__AGGRESSIVE_UPDATE_PACKAGES=none
+ CONDA__AGGRESSIVE_UPDATE_PACKAGES=none
+ cd /tmp/tmp.q7Mg5Cd6hm
+ bash /home/maba/code/conda/Anaconda3-5.0.1-Linux-x86_64.sh -bfp .
Python 3.6.3 :: Anaconda, Inc.
+ source bin/activate
+ alias conda=bin/conda
+ conda update -q conda


Package plan for installation in environment /tmp/tmp.q7Mg5Cd6hm:

The following packages will be UPDATED:

    anaconda: 5.0.1-py36hd30a520_1  --> custom-py36hbbc8b67_0
    conda:    4.3.30-py36h5d9f9f4_0 --> 4.4.7-py36_0
    pycosat:  0.6.2-py36h1a0ea17_1  --> 0.6.3-py36h0a5515d_0

+ cat conda-meta/history
==> 2018-01-24 16:03:01 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda update -q conda
+defaults::_ipyw_jlab_nb_ext_conf-0.1.0-py36he11e457_0
+defaults::alabaster-0.7.10-py36h306e16b_0
+defaults::anaconda-5.0.1-py36hd30a520_1
+defaults::anaconda-client-1.6.5-py36h19c0dcd_0
+defaults::anaconda-navigator-1.6.9-py36h11ddaaa_0
+defaults::anaconda-project-0.8.0-py36h29abdf5_0
+defaults::asn1crypto-0.22.0-py36h265ca7c_1
+defaults::astroid-1.5.3-py36hbdb9df2_0
+defaults::astropy-2.0.2-py36ha51211e_4
+defaults::babel-2.5.0-py36h7d14adf_0
+defaults::backports-1.0-py36hfa02d7e_1
+defaults::backports.shutil_get_terminal_size-1.0.0-py36hfea85ff_2
+defaults::beautifulsoup4-4.6.0-py36h49b8c8c_1
+defaults::bitarray-0.8.1-py36h5834eb8_0
+defaults::bkcharts-0.2-py36h735825a_0
+defaults::blaze-0.11.3-py36h4e06776_0
+defaults::bleach-2.0.0-py36h688b259_0
+defaults::bokeh-0.12.10-py36hbb0e44a_0
+defaults::boto-2.48.0-py36h6e4cd66_1
+defaults::bottleneck-1.2.1-py36haac1ea0_0
+defaults::bzip2-1.0.6-h0376d23_1
+defaults::ca-certificates-2017.08.26-h1d4fec5_0
+defaults::cairo-1.14.10-haa5651f_5
+defaults::certifi-2017.7.27.1-py36h8b7b77e_0
+defaults::cffi-1.10.0-py36had8d393_1
+defaults::chardet-3.0.4-py36h0f667ec_1
+defaults::click-6.7-py36h5253387_0
+defaults::cloudpickle-0.4.0-py36h30f8c20_0
+defaults::clyent-1.2.2-py36h7e57e65_1
+defaults::colorama-0.3.9-py36h489cec4_0
+defaults::conda-4.3.30-py36h5d9f9f4_0
+defaults::conda-build-3.0.27-py36h940a66d_0
+defaults::conda-env-2.6.0-h36134e3_1
+defaults::conda-verify-2.0.0-py36h98955d8_0
+defaults::contextlib2-0.5.5-py36h6c84a62_0
+defaults::cryptography-2.0.3-py36ha225213_1
+defaults::curl-7.55.1-hcb0b314_2
+defaults::cycler-0.10.0-py36h93f1223_0
+defaults::cython-0.26.1-py36h21c49d0_0
+defaults::cytoolz-0.8.2-py36h708bfd4_0
+defaults::dask-0.15.3-py36hdc2c8aa_0
+defaults::dask-core-0.15.3-py36h10e6167_0
+defaults::datashape-0.5.4-py36h3ad6b5c_0
+defaults::dbus-1.10.22-h3b5a359_0
+defaults::decorator-4.1.2-py36hd076ac8_0
+defaults::distributed-1.19.1-py36h25f3894_0
+defaults::docutils-0.14-py36hb0f60f5_0
+defaults::entrypoints-0.2.3-py36h1aec115_2
+defaults::et_xmlfile-1.0.1-py36hd6bccc3_0
+defaults::expat-2.2.4-hc00ebd1_1
+defaults::fastcache-1.0.2-py36h5b0c431_0
+defaults::filelock-2.0.12-py36hacfa1f5_0
+defaults::flask-0.12.2-py36hb24657c_0
+defaults::flask-cors-3.0.3-py36h2d857d3_0
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-h52ed37b_0
+defaults::get_terminal_size-1.0.0-haa9412d_0
+defaults::gevent-1.2.2-py36h2fe25dc_0
+defaults::glib-2.53.6-hc861d11_1
+defaults::glob2-0.5-py36h2c1b292_1
+defaults::gmp-6.1.2-hb3b607b_0
+defaults::gmpy2-2.0.8-py36h55090d7_1
+defaults::graphite2-1.3.10-hc526e54_0
+defaults::greenlet-0.4.12-py36h2d503a6_0
+defaults::gst-plugins-base-1.12.2-he3457e5_0
+defaults::gstreamer-1.12.2-h4f93127_0
+defaults::h5py-2.7.0-py36he81ebca_1
+defaults::harfbuzz-1.5.0-h2545bd6_0
+defaults::hdf5-1.10.1-hb0523eb_0
+defaults::heapdict-1.0.0-py36h79797d7_0
+defaults::html5lib-0.999999999-py36h2cfc398_0
+defaults::icu-58.2-h211956c_0
+defaults::idna-2.6-py36h82fb2a8_1
+defaults::imageio-2.2.0-py36he555465_0
+defaults::imagesize-0.7.1-py36h52d8127_0
+defaults::intel-openmp-2018.0.0-h15fc484_7
+defaults::ipykernel-4.6.1-py36hbf841aa_0
+defaults::ipython-6.1.0-py36hc72a948_1
+defaults::ipython_genutils-0.2.0-py36hb52b0d5_0
+defaults::ipywidgets-7.0.0-py36h7b55c3a_0
+defaults::isort-4.2.15-py36had401c0_0
+defaults::itsdangerous-0.24-py36h93cc618_1
+defaults::jbig-2.1-hdba287a_0
+defaults::jdcal-1.3-py36h4c697fb_0
+defaults::jedi-0.10.2-py36h552def0_0
+defaults::jinja2-2.9.6-py36h489bce4_1
+defaults::jpeg-9b-habf39ab_1
+defaults::jsonschema-2.6.0-py36h006f8b5_0
+defaults::jupyter-1.0.0-py36h9896ce5_0
+defaults::jupyter_client-5.1.0-py36h614e9ea_0
+defaults::jupyter_console-5.2.0-py36he59e554_1
+defaults::jupyter_core-4.3.0-py36h357a921_0
+defaults::jupyterlab-0.27.0-py36h86377d0_2
+defaults::jupyterlab_launcher-0.4.0-py36h4d8058d_0
+defaults::lazy-object-proxy-1.3.1-py36h10fcdad_0
+defaults::libedit-3.1-heed3624_0
+defaults::libffi-3.2.1-h4deb6c0_3
+defaults::libgcc-ng-7.2.0-h7cc24e2_2
+defaults::libgfortran-ng-7.2.0-h9f7466a_2
+defaults::libpng-1.6.32-hda9c8bc_2
+defaults::libsodium-1.0.13-h31c71d8_2
+defaults::libssh2-1.8.0-h8c220ad_2
+defaults::libstdcxx-ng-7.2.0-h7a57d05_2
+defaults::libtiff-4.0.8-h90200ff_9
+defaults::libtool-2.4.6-hd50d1a6_0
+defaults::libxcb-1.12-h84ff03f_3
+defaults::libxml2-2.9.4-h6b072ca_5
+defaults::libxslt-1.1.29-hcf9102b_5
+defaults::llvmlite-0.20.0-py36_0
+defaults::locket-0.2.0-py36h787c0ad_1
+defaults::lxml-4.1.0-py36h5b66e50_0
+defaults::lzo-2.10-h1bfc0ba_1
+defaults::markupsafe-1.0-py36hd9260cd_1
+defaults::matplotlib-2.1.0-py36hba5de38_0
+defaults::mccabe-0.6.1-py36h5ad9710_1
+defaults::mistune-0.7.4-py36hbab8784_0
+defaults::mkl-2018.0.0-hb491cac_4
+defaults::mkl-service-1.1.2-py36h17a0993_4
+defaults::mpc-1.0.3-hf803216_4
+defaults::mpfr-3.1.5-h12ff648_1
+defaults::mpmath-0.19-py36h8cc018b_2
+defaults::msgpack-python-0.4.8-py36hec4c5d1_0
+defaults::multipledispatch-0.4.9-py36h41da3fb_0
+defaults::navigator-updater-0.1.0-py36h14770f7_0
+defaults::nbconvert-5.3.1-py36hb41ffb7_0
+defaults::nbformat-4.4.0-py36h31c9010_0
+defaults::ncurses-6.0-h06874d7_1
+defaults::networkx-2.0-py36h7e96fb8_0
+defaults::nltk-3.2.4-py36h1a0979f_0
+defaults::nose-1.3.7-py36hcdf7029_2
+defaults::notebook-5.0.0-py36h0b20546_2
+defaults::numba-0.35.0-np113py36_10
+defaults::numexpr-2.6.2-py36hdd3393f_1
+defaults::numpy-1.13.3-py36ha12f23b_0
+defaults::numpydoc-0.7.0-py36h18f165f_0
+defaults::odo-0.5.1-py36h90ed295_0
+defaults::olefile-0.44-py36h79f9f78_0
+defaults::openpyxl-2.4.8-py36h41dd2a8_1
+defaults::openssl-1.0.2l-h077ae2c_5
+defaults::packaging-16.8-py36ha668100_1
+defaults::pandas-0.20.3-py36h842e28d_2
+defaults::pandoc-1.19.2.1-hea2e7c5_1
+defaults::pandocfilters-1.4.2-py36ha6701b7_1
+defaults::pango-1.40.11-h8191d47_0
+defaults::partd-0.3.8-py36h36fd896_0
+defaults::patchelf-0.9-hf79760b_2
+defaults::path.py-10.3.1-py36he0c6f6d_0
+defaults::pathlib2-2.3.0-py36h49efa8e_0
+defaults::patsy-0.4.1-py36ha3be15e_0
+defaults::pcre-8.41-hc71a17e_0
+defaults::pep8-1.7.0-py36h26ade29_0
+defaults::pexpect-4.2.1-py36h3b9d41b_0
+defaults::pickleshare-0.7.4-py36h63277f8_0
+defaults::pillow-4.2.1-py36h9119f52_0
+defaults::pip-9.0.1-py36h8ec8b28_3
+defaults::pixman-0.34.0-h83dc358_2
+defaults::pkginfo-1.4.1-py36h215d178_1
+defaults::ply-3.10-py36hed35086_0
+defaults::prompt_toolkit-1.0.15-py36h17d85b1_0
+defaults::psutil-5.4.0-py36h84c53db_0
+defaults::ptyprocess-0.5.2-py36h69acd42_0
+defaults::py-1.4.34-py36h0712aa3_1
+defaults::pycodestyle-2.3.1-py36hf609f19_0
+defaults::pycosat-0.6.2-py36h1a0ea17_1
+defaults::pycparser-2.18-py36hf9f622e_1
+defaults::pycrypto-2.6.1-py36h6998063_1
+defaults::pycurl-7.43.0-py36h5e72054_3
+defaults::pyflakes-1.6.0-py36h7bd6a15_0
+defaults::pygments-2.2.0-py36h0d3125c_0
+defaults::pylint-1.7.4-py36hb9d4533_0
+defaults::pyodbc-4.0.17-py36h999153c_0
+defaults::pyopenssl-17.2.0-py36h5cc804b_0
+defaults::pyparsing-2.2.0-py36hee85983_1
+defaults::pyqt-5.6.0-py36h0386399_5
+defaults::pysocks-1.6.7-py36hd97a5b1_1
+defaults::pytables-3.4.2-py36h3b5282a_2
+defaults::pytest-3.2.1-py36h11ad3bb_1
+defaults::python-3.6.3-hc9025b9_1
+defaults::python-dateutil-2.6.1-py36h88d3b88_1
+defaults::pytz-2017.2-py36hc2ccc2a_1
+defaults::pywavelets-0.5.2-py36he602eb0_0
+defaults::pyyaml-3.12-py36hafb9ca4_1
+defaults::pyzmq-16.0.2-py36h3b0cf96_2
+defaults::qt-5.6.2-h974d657_12
+defaults::qtawesome-0.4.4-py36h609ed8c_0
+defaults::qtconsole-4.3.1-py36h8f73b5b_0
+defaults::qtpy-1.3.1-py36h3691cc8_0
+defaults::readline-7.0-hac23ff0_3
+defaults::requests-2.18.4-py36he2e5f8d_1
+defaults::rope-0.10.5-py36h1f8c17e_0
+defaults::ruamel_yaml-0.11.14-py36ha2fb22d_2
+defaults::scikit-image-0.13.0-py36had3c07a_1
+defaults::scikit-learn-0.19.1-py36h7aa7ec6_0
+defaults::scipy-0.19.1-py36h9976243_3
+defaults::seaborn-0.8.0-py36h197244f_0
+defaults::setuptools-36.5.0-py36he42e2e1_0
+defaults::simplegeneric-0.8.1-py36h2cb9092_0
+defaults::singledispatch-3.4.0.3-py36h7a266c3_0
+defaults::sip-4.18.1-py36h51ed4ed_2
+defaults::six-1.11.0-py36h372c433_1
+defaults::snowballstemmer-1.2.1-py36h6febd40_0
+defaults::sortedcollections-0.5.3-py36h3c761f9_0
+defaults::sortedcontainers-1.5.7-py36hdf89491_0
+defaults::sphinx-1.6.3-py36he5f0bdb_0
+defaults::sphinxcontrib-1.0-py36h6d0f590_1
+defaults::sphinxcontrib-websupport-1.0.1-py36hb5cb234_1
+defaults::spyder-3.2.4-py36hbe6152b_0
+defaults::sqlalchemy-1.1.13-py36hfb5efd7_0
+defaults::sqlite-3.20.1-h6d8b0f3_1
+defaults::statsmodels-0.8.0-py36h8533d0b_0
+defaults::sympy-1.1.1-py36hc6d1c1c_0
+defaults::tblib-1.3.2-py36h34cf8b6_0
+defaults::terminado-0.6-py36ha25a19f_0
+defaults::testpath-0.3.1-py36h8cadb63_0
+defaults::tk-8.6.7-h5979e9b_1
+defaults::toolz-0.8.2-py36h81f2dff_0
+defaults::tornado-4.5.2-py36h1283b2a_0
+defaults::traitlets-4.3.2-py36h674d592_0
+defaults::typing-3.6.2-py36h7da032a_0
+defaults::unicodecsv-0.14.1-py36ha668878_0
+defaults::unixodbc-2.3.4-hc36303a_1
+defaults::urllib3-1.22-py36hbe7ace6_0
+defaults::wcwidth-0.1.7-py36hdf4376a_0
+defaults::webencodings-0.5.1-py36h800622e_1
+defaults::werkzeug-0.12.2-py36hc703753_0
+defaults::wheel-0.29.0-py36he7f4e38_1
+defaults::widgetsnbextension-3.0.2-py36hd01bb71_1
+defaults::wrapt-1.10.11-py36h28b7045_0
+defaults::xlrd-1.1.0-py36h1db9f0c_1
+defaults::xlsxwriter-1.0.2-py36h3de1aca_0
+defaults::xlwt-1.3.0-py36h7b00a1f_0
+defaults::xz-5.2.3-h2bcbf08_1
+defaults::yaml-0.1.7-h96e3832_1
+defaults::zeromq-4.2.2-hb0b69da_1
+defaults::zict-0.1.3-py36h3a3bf81_0
+defaults::zlib-1.2.11-hfbfcf68_1
==> 2018-01-24 16:03:02 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda update -q conda
-defaults::anaconda-5.0.1-py36hd30a520_1
-defaults::conda-4.3.30-py36h5d9f9f4_0
-defaults::pycosat-0.6.2-py36h1a0ea17_1
+defaults::anaconda-custom-py36hbbc8b67_0
+defaults::conda-4.4.7-py36_0
+defaults::pycosat-0.6.3-py36h0a5515d_0
# update specs: conda
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - hdf5 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
Use "conda info <package>" to see the dependencies for each package.

+ CONDA_PINNED_PACKAGES=anaconda=custom
+ conda install -qf anaconda
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - anaconda


The following packages will be DOWNGRADED:

    anaconda: custom-py36hbbc8b67_0 --> custom-py36hbbc8b67_0

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
+ show-latest-history
+ sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history
==> 2018-01-24 16:04:21 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda install -qf anaconda
# update specs: ['anaconda']
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - zlib[version='<1.2.11']


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    readline-6.2               |                2         606 KB
    sqlite-3.13.0              |                0         4.0 MB
    libxslt-1.1.29             |                0         983 KB
    tk-8.5.18                  |                0         1.9 MB
    fontconfig-2.12.1          |                3         429 KB
    python-3.6.2               |                0        16.5 MB
    freetype-2.5.5             |                2         2.5 MB
    pillow-4.2.1               |           py36_0         870 KB
    libxml2-2.9.4              |                0         3.7 MB
    dbus-1.10.20               |                0         1.4 MB
    harfbuzz-0.9.39            |                2         1.2 MB
    hdf5-1.8.17                |                2         2.0 MB
    pango-1.40.3               |                1         938 KB
    pcre-8.39                  |                1         656 KB
    qt-5.6.2                   |                5        43.5 MB
    curl-7.52.1                |                0         558 KB
    pycurl-7.43.0              |           py36_2         139 KB
    gstreamer-1.8.0            |                0         2.6 MB
    libtiff-4.0.6              |                3         1.5 MB
    pyqt-5.6.0                 |           py36_2         5.4 MB
    libpng-1.6.30              |                1         220 KB
    icu-54.1                   |                0        11.3 MB
    glib-2.50.2                |                1         5.6 MB
    h5py-2.7.0                 |      np113py36_0         2.9 MB
    libiconv-1.14              |                0         2.0 MB
    gst-plugins-base-1.8.0     |                0         3.1 MB
    cairo-1.14.8               |                0         609 KB
    matplotlib-2.0.2           |      np113py36_0        10.9 MB
    libgcc-7.2.0               |       h69d50b8_2         304 KB
    zlib-1.2.8                 |                3         101 KB
    pytables-3.4.2             |      np113py36_0         6.1 MB
    ------------------------------------------------------------
                                           Total:       134.1 MB

The following NEW packages will be INSTALLED:

    libgcc:           7.2.0-h69d50b8_2
    libiconv:         1.14-0

The following packages will be UPDATED:

    pillow:           4.2.1-py36h9119f52_0  --> 4.2.1-py36_0

The following packages will be DOWNGRADED:

    cairo:            1.14.10-haa5651f_5    --> 1.14.8-0
    curl:             7.55.1-hcb0b314_2     --> 7.52.1-0
    dbus:             1.10.22-h3b5a359_0    --> 1.10.20-0
    fontconfig:       2.12.4-h88586e7_1     --> 2.12.1-3
    freetype:         2.8-h52ed37b_0        --> 2.5.5-2
    glib:             2.53.6-hc861d11_1     --> 2.50.2-1
    gst-plugins-base: 1.12.2-he3457e5_0     --> 1.8.0-0
    gstreamer:        1.12.2-h4f93127_0     --> 1.8.0-0
    h5py:             2.7.0-py36he81ebca_1  --> 2.7.0-np113py36_0
    harfbuzz:         1.5.0-h2545bd6_0      --> 0.9.39-2
    hdf5:             1.10.1-hb0523eb_0     --> 1.8.17-2
    icu:              58.2-h211956c_0       --> 54.1-0
    libpng:           1.6.32-hda9c8bc_2     --> 1.6.30-1
    libtiff:          4.0.8-h90200ff_9      --> 4.0.6-3
    libxml2:          2.9.4-h6b072ca_5      --> 2.9.4-0
    libxslt:          1.1.29-hcf9102b_5     --> 1.1.29-0
    matplotlib:       2.1.0-py36hba5de38_0  --> 2.0.2-np113py36_0
    pango:            1.40.11-h8191d47_0    --> 1.40.3-1
    pcre:             8.41-hc71a17e_0       --> 8.39-1
    pycurl:           7.43.0-py36h5e72054_3 --> 7.43.0-py36_2
    pyqt:             5.6.0-py36h0386399_5  --> 5.6.0-py36_2
    pytables:         3.4.2-py36h3b5282a_2  --> 3.4.2-np113py36_0
    python:           3.6.3-hc9025b9_1      --> 3.6.2-0
    qt:               5.6.2-h974d657_12     --> 5.6.2-5
    readline:         7.0-hac23ff0_3        --> 6.2-2
    sqlite:           3.20.1-h6d8b0f3_1     --> 3.13.0-0
    tk:               8.6.7-h5979e9b_1      --> 8.5.18-0
    zlib:             1.2.11-hfbfcf68_1     --> 1.2.8-3

+ conda remove -q anaconda
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  removed specs:
    - anaconda


The following packages will be REMOVED:

    anaconda: custom-py36hbbc8b67_0

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
+ show-latest-history
+ sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history
==> 2018-01-24 16:05:34 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda remove -q anaconda
+defaults::_ipyw_jlab_nb_ext_conf-0.1.0-py36he11e457_0
+defaults::alabaster-0.7.10-py36h306e16b_0
+defaults::anaconda-client-1.6.5-py36h19c0dcd_0
+defaults::anaconda-navigator-1.6.9-py36h11ddaaa_0
+defaults::anaconda-project-0.8.0-py36h29abdf5_0
+defaults::asn1crypto-0.22.0-py36h265ca7c_1
+defaults::astroid-1.5.3-py36hbdb9df2_0
+defaults::astropy-2.0.2-py36ha51211e_4
+defaults::babel-2.5.0-py36h7d14adf_0
+defaults::backports-1.0-py36hfa02d7e_1
+defaults::backports.shutil_get_terminal_size-1.0.0-py36hfea85ff_2
+defaults::beautifulsoup4-4.6.0-py36h49b8c8c_1
+defaults::bitarray-0.8.1-py36h5834eb8_0
+defaults::bkcharts-0.2-py36h735825a_0
+defaults::blaze-0.11.3-py36h4e06776_0
+defaults::bleach-2.0.0-py36h688b259_0
+defaults::bokeh-0.12.10-py36hbb0e44a_0
+defaults::boto-2.48.0-py36h6e4cd66_1
+defaults::bottleneck-1.2.1-py36haac1ea0_0
+defaults::bzip2-1.0.6-h0376d23_1
+defaults::ca-certificates-2017.08.26-h1d4fec5_0
+defaults::cairo-1.14.10-haa5651f_5
+defaults::certifi-2017.7.27.1-py36h8b7b77e_0
+defaults::cffi-1.10.0-py36had8d393_1
+defaults::chardet-3.0.4-py36h0f667ec_1
+defaults::click-6.7-py36h5253387_0
+defaults::cloudpickle-0.4.0-py36h30f8c20_0
+defaults::clyent-1.2.2-py36h7e57e65_1
+defaults::colorama-0.3.9-py36h489cec4_0
+defaults::conda-4.4.7-py36_0
+defaults::conda-build-3.0.27-py36h940a66d_0
+defaults::conda-env-2.6.0-h36134e3_1
+defaults::conda-verify-2.0.0-py36h98955d8_0
+defaults::contextlib2-0.5.5-py36h6c84a62_0
+defaults::cryptography-2.0.3-py36ha225213_1
+defaults::curl-7.55.1-hcb0b314_2
+defaults::cycler-0.10.0-py36h93f1223_0
+defaults::cython-0.26.1-py36h21c49d0_0
+defaults::cytoolz-0.8.2-py36h708bfd4_0
+defaults::dask-0.15.3-py36hdc2c8aa_0
+defaults::dask-core-0.15.3-py36h10e6167_0
+defaults::datashape-0.5.4-py36h3ad6b5c_0
+defaults::dbus-1.10.22-h3b5a359_0
+defaults::decorator-4.1.2-py36hd076ac8_0
+defaults::distributed-1.19.1-py36h25f3894_0
+defaults::docutils-0.14-py36hb0f60f5_0
+defaults::entrypoints-0.2.3-py36h1aec115_2
+defaults::et_xmlfile-1.0.1-py36hd6bccc3_0
+defaults::expat-2.2.4-hc00ebd1_1
+defaults::fastcache-1.0.2-py36h5b0c431_0
+defaults::filelock-2.0.12-py36hacfa1f5_0
+defaults::flask-0.12.2-py36hb24657c_0
+defaults::flask-cors-3.0.3-py36h2d857d3_0
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-h52ed37b_0
+defaults::get_terminal_size-1.0.0-haa9412d_0
+defaults::gevent-1.2.2-py36h2fe25dc_0
+defaults::glib-2.53.6-hc861d11_1
+defaults::glob2-0.5-py36h2c1b292_1
+defaults::gmp-6.1.2-hb3b607b_0
+defaults::gmpy2-2.0.8-py36h55090d7_1
+defaults::graphite2-1.3.10-hc526e54_0
+defaults::greenlet-0.4.12-py36h2d503a6_0
+defaults::gst-plugins-base-1.12.2-he3457e5_0
+defaults::gstreamer-1.12.2-h4f93127_0
+defaults::h5py-2.7.0-py36he81ebca_1
+defaults::harfbuzz-1.5.0-h2545bd6_0
+defaults::hdf5-1.10.1-hb0523eb_0
+defaults::heapdict-1.0.0-py36h79797d7_0
+defaults::html5lib-0.999999999-py36h2cfc398_0
+defaults::icu-58.2-h211956c_0
+defaults::idna-2.6-py36h82fb2a8_1
+defaults::imageio-2.2.0-py36he555465_0
+defaults::imagesize-0.7.1-py36h52d8127_0
+defaults::intel-openmp-2018.0.0-h15fc484_7
+defaults::ipykernel-4.6.1-py36hbf841aa_0
+defaults::ipython-6.1.0-py36hc72a948_1
+defaults::ipython_genutils-0.2.0-py36hb52b0d5_0
+defaults::ipywidgets-7.0.0-py36h7b55c3a_0
+defaults::isort-4.2.15-py36had401c0_0
+defaults::itsdangerous-0.24-py36h93cc618_1
+defaults::jbig-2.1-hdba287a_0
+defaults::jdcal-1.3-py36h4c697fb_0
+defaults::jedi-0.10.2-py36h552def0_0
+defaults::jinja2-2.9.6-py36h489bce4_1
+defaults::jpeg-9b-habf39ab_1
+defaults::jsonschema-2.6.0-py36h006f8b5_0
+defaults::jupyter-1.0.0-py36h9896ce5_0
+defaults::jupyter_client-5.1.0-py36h614e9ea_0
+defaults::jupyter_console-5.2.0-py36he59e554_1
+defaults::jupyter_core-4.3.0-py36h357a921_0
+defaults::jupyterlab-0.27.0-py36h86377d0_2
+defaults::jupyterlab_launcher-0.4.0-py36h4d8058d_0
+defaults::lazy-object-proxy-1.3.1-py36h10fcdad_0
+defaults::libedit-3.1-heed3624_0
+defaults::libffi-3.2.1-h4deb6c0_3
+defaults::libgcc-ng-7.2.0-h7cc24e2_2
+defaults::libgfortran-ng-7.2.0-h9f7466a_2
+defaults::libpng-1.6.32-hda9c8bc_2
+defaults::libsodium-1.0.13-h31c71d8_2
+defaults::libssh2-1.8.0-h8c220ad_2
+defaults::libstdcxx-ng-7.2.0-h7a57d05_2
+defaults::libtiff-4.0.8-h90200ff_9
+defaults::libtool-2.4.6-hd50d1a6_0
+defaults::libxcb-1.12-h84ff03f_3
+defaults::libxml2-2.9.4-h6b072ca_5
+defaults::libxslt-1.1.29-hcf9102b_5
+defaults::llvmlite-0.20.0-py36_0
+defaults::locket-0.2.0-py36h787c0ad_1
+defaults::lxml-4.1.0-py36h5b66e50_0
+defaults::lzo-2.10-h1bfc0ba_1
+defaults::markupsafe-1.0-py36hd9260cd_1
+defaults::matplotlib-2.1.0-py36hba5de38_0
+defaults::mccabe-0.6.1-py36h5ad9710_1
+defaults::mistune-0.7.4-py36hbab8784_0
+defaults::mkl-2018.0.0-hb491cac_4
+defaults::mkl-service-1.1.2-py36h17a0993_4
+defaults::mpc-1.0.3-hf803216_4
+defaults::mpfr-3.1.5-h12ff648_1
+defaults::mpmath-0.19-py36h8cc018b_2
+defaults::msgpack-python-0.4.8-py36hec4c5d1_0
+defaults::multipledispatch-0.4.9-py36h41da3fb_0
+defaults::navigator-updater-0.1.0-py36h14770f7_0
+defaults::nbconvert-5.3.1-py36hb41ffb7_0
+defaults::nbformat-4.4.0-py36h31c9010_0
+defaults::ncurses-6.0-h06874d7_1
+defaults::networkx-2.0-py36h7e96fb8_0
+defaults::nltk-3.2.4-py36h1a0979f_0
+defaults::nose-1.3.7-py36hcdf7029_2
+defaults::notebook-5.0.0-py36h0b20546_2
+defaults::numba-0.35.0-np113py36_10
+defaults::numexpr-2.6.2-py36hdd3393f_1
+defaults::numpy-1.13.3-py36ha12f23b_0
+defaults::numpydoc-0.7.0-py36h18f165f_0
+defaults::odo-0.5.1-py36h90ed295_0
+defaults::olefile-0.44-py36h79f9f78_0
+defaults::openpyxl-2.4.8-py36h41dd2a8_1
+defaults::openssl-1.0.2l-h077ae2c_5
+defaults::packaging-16.8-py36ha668100_1
+defaults::pandas-0.20.3-py36h842e28d_2
+defaults::pandoc-1.19.2.1-hea2e7c5_1
+defaults::pandocfilters-1.4.2-py36ha6701b7_1
+defaults::pango-1.40.11-h8191d47_0
+defaults::partd-0.3.8-py36h36fd896_0
+defaults::patchelf-0.9-hf79760b_2
+defaults::path.py-10.3.1-py36he0c6f6d_0
+defaults::pathlib2-2.3.0-py36h49efa8e_0
+defaults::patsy-0.4.1-py36ha3be15e_0
+defaults::pcre-8.41-hc71a17e_0
+defaults::pep8-1.7.0-py36h26ade29_0
+defaults::pexpect-4.2.1-py36h3b9d41b_0
+defaults::pickleshare-0.7.4-py36h63277f8_0
+defaults::pillow-4.2.1-py36h9119f52_0
+defaults::pip-9.0.1-py36h8ec8b28_3
+defaults::pixman-0.34.0-h83dc358_2
+defaults::pkginfo-1.4.1-py36h215d178_1
+defaults::ply-3.10-py36hed35086_0
+defaults::prompt_toolkit-1.0.15-py36h17d85b1_0
+defaults::psutil-5.4.0-py36h84c53db_0
+defaults::ptyprocess-0.5.2-py36h69acd42_0
+defaults::py-1.4.34-py36h0712aa3_1
+defaults::pycodestyle-2.3.1-py36hf609f19_0
+defaults::pycosat-0.6.3-py36h0a5515d_0
+defaults::pycparser-2.18-py36hf9f622e_1
+defaults::pycrypto-2.6.1-py36h6998063_1
+defaults::pycurl-7.43.0-py36h5e72054_3
+defaults::pyflakes-1.6.0-py36h7bd6a15_0
+defaults::pygments-2.2.0-py36h0d3125c_0
+defaults::pylint-1.7.4-py36hb9d4533_0
+defaults::pyodbc-4.0.17-py36h999153c_0
+defaults::pyopenssl-17.2.0-py36h5cc804b_0
+defaults::pyparsing-2.2.0-py36hee85983_1
+defaults::pyqt-5.6.0-py36h0386399_5
+defaults::pysocks-1.6.7-py36hd97a5b1_1
+defaults::pytables-3.4.2-py36h3b5282a_2
+defaults::pytest-3.2.1-py36h11ad3bb_1
+defaults::python-3.6.3-hc9025b9_1
+defaults::python-dateutil-2.6.1-py36h88d3b88_1
+defaults::pytz-2017.2-py36hc2ccc2a_1
+defaults::pywavelets-0.5.2-py36he602eb0_0
+defaults::pyyaml-3.12-py36hafb9ca4_1
+defaults::pyzmq-16.0.2-py36h3b0cf96_2
+defaults::qt-5.6.2-h974d657_12
+defaults::qtawesome-0.4.4-py36h609ed8c_0
+defaults::qtconsole-4.3.1-py36h8f73b5b_0
+defaults::qtpy-1.3.1-py36h3691cc8_0
+defaults::readline-7.0-hac23ff0_3
+defaults::requests-2.18.4-py36he2e5f8d_1
+defaults::rope-0.10.5-py36h1f8c17e_0
+defaults::ruamel_yaml-0.11.14-py36ha2fb22d_2
+defaults::scikit-image-0.13.0-py36had3c07a_1
+defaults::scikit-learn-0.19.1-py36h7aa7ec6_0
+defaults::scipy-0.19.1-py36h9976243_3
+defaults::seaborn-0.8.0-py36h197244f_0
+defaults::setuptools-36.5.0-py36he42e2e1_0
+defaults::simplegeneric-0.8.1-py36h2cb9092_0
+defaults::singledispatch-3.4.0.3-py36h7a266c3_0
+defaults::sip-4.18.1-py36h51ed4ed_2
+defaults::six-1.11.0-py36h372c433_1
+defaults::snowballstemmer-1.2.1-py36h6febd40_0
+defaults::sortedcollections-0.5.3-py36h3c761f9_0
+defaults::sortedcontainers-1.5.7-py36hdf89491_0
+defaults::sphinx-1.6.3-py36he5f0bdb_0
+defaults::sphinxcontrib-1.0-py36h6d0f590_1
+defaults::sphinxcontrib-websupport-1.0.1-py36hb5cb234_1
+defaults::spyder-3.2.4-py36hbe6152b_0
+defaults::sqlalchemy-1.1.13-py36hfb5efd7_0
+defaults::sqlite-3.20.1-h6d8b0f3_1
+defaults::statsmodels-0.8.0-py36h8533d0b_0
+defaults::sympy-1.1.1-py36hc6d1c1c_0
+defaults::tblib-1.3.2-py36h34cf8b6_0
+defaults::terminado-0.6-py36ha25a19f_0
+defaults::testpath-0.3.1-py36h8cadb63_0
+defaults::tk-8.6.7-h5979e9b_1
+defaults::toolz-0.8.2-py36h81f2dff_0
+defaults::tornado-4.5.2-py36h1283b2a_0
+defaults::traitlets-4.3.2-py36h674d592_0
+defaults::typing-3.6.2-py36h7da032a_0
+defaults::unicodecsv-0.14.1-py36ha668878_0
+defaults::unixodbc-2.3.4-hc36303a_1
+defaults::urllib3-1.22-py36hbe7ace6_0
+defaults::wcwidth-0.1.7-py36hdf4376a_0
+defaults::webencodings-0.5.1-py36h800622e_1
+defaults::werkzeug-0.12.2-py36hc703753_0
+defaults::wheel-0.29.0-py36he7f4e38_1
+defaults::widgetsnbextension-3.0.2-py36hd01bb71_1
+defaults::wrapt-1.10.11-py36h28b7045_0
+defaults::xlrd-1.1.0-py36h1db9f0c_1
+defaults::xlsxwriter-1.0.2-py36h3de1aca_0
+defaults::xlwt-1.3.0-py36h7b00a1f_0
+defaults::xz-5.2.3-h2bcbf08_1
+defaults::yaml-0.1.7-h96e3832_1
+defaults::zeromq-4.2.2-hb0b69da_1
+defaults::zict-0.1.3-py36h3a3bf81_0
+defaults::zlib-1.2.11-hfbfcf68_1
# remove specs: ['anaconda']
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - hdf5 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
Use "conda info <package>" to see the dependencies for each package.

+ conda install -q anaconda=custom
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - anaconda=custom


The following NEW packages will be INSTALLED:

    anaconda: custom-py36hbbc8b67_0

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
+ show-latest-history
+ sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history
==> 2018-01-24 16:06:27 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda install -q anaconda=custom
+defaults::anaconda-custom-py36hbbc8b67_0
# update specs: ['anaconda=custom']
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - zlib[version='<1.2.11']


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libxslt-1.1.29             |                0         983 KB
    dbus-1.10.20               |                0         1.4 MB
    glib-2.50.2                |                1         5.6 MB
    libtiff-4.0.6              |                3         1.5 MB
    harfbuzz-0.9.39            |                2         1.2 MB
    qt-5.6.2                   |                5        43.5 MB
    icu-54.1                   |                0        11.3 MB
    h5py-2.7.0                 |      np113py36_0         2.9 MB
    zlib-1.2.8                 |                3         101 KB
    pytables-3.4.2             |      np113py36_0         6.1 MB
    pcre-8.39                  |                1         656 KB
    hdf5-1.8.17                |                2         2.0 MB
    gstreamer-1.8.0            |                0         2.6 MB
    gst-plugins-base-1.8.0     |                0         3.1 MB
    pycurl-7.43.0              |           py36_2         139 KB
    pyqt-5.6.0                 |           py36_2         5.4 MB
    libpng-1.6.30              |                1         220 KB
    pillow-4.2.1               |           py36_0         870 KB
    libiconv-1.14              |                0         2.0 MB
    pango-1.40.3               |                1         938 KB
    tk-8.5.18                  |                0         1.9 MB
    python-3.6.2               |                0        16.5 MB
    freetype-2.5.5             |                2         2.5 MB
    matplotlib-2.0.2           |      np113py36_0        10.9 MB
    cairo-1.14.8               |                0         609 KB
    sqlite-3.13.0              |                0         4.0 MB
    libgcc-7.2.0               |       h69d50b8_2         304 KB
    curl-7.52.1                |                0         558 KB
    libxml2-2.9.4              |                0         3.7 MB
    fontconfig-2.12.1          |                3         429 KB
    readline-6.2               |                2         606 KB
    ------------------------------------------------------------
                                           Total:       134.1 MB

The following NEW packages will be INSTALLED:

    libgcc:           7.2.0-h69d50b8_2
    libiconv:         1.14-0

The following packages will be UPDATED:

    pillow:           4.2.1-py36h9119f52_0  --> 4.2.1-py36_0

The following packages will be DOWNGRADED:

    cairo:            1.14.10-haa5651f_5    --> 1.14.8-0
    curl:             7.55.1-hcb0b314_2     --> 7.52.1-0
    dbus:             1.10.22-h3b5a359_0    --> 1.10.20-0
    fontconfig:       2.12.4-h88586e7_1     --> 2.12.1-3
    freetype:         2.8-h52ed37b_0        --> 2.5.5-2
    glib:             2.53.6-hc861d11_1     --> 2.50.2-1
    gst-plugins-base: 1.12.2-he3457e5_0     --> 1.8.0-0
    gstreamer:        1.12.2-h4f93127_0     --> 1.8.0-0
    h5py:             2.7.0-py36he81ebca_1  --> 2.7.0-np113py36_0
    harfbuzz:         1.5.0-h2545bd6_0      --> 0.9.39-2
    hdf5:             1.10.1-hb0523eb_0     --> 1.8.17-2
    icu:              58.2-h211956c_0       --> 54.1-0
    libpng:           1.6.32-hda9c8bc_2     --> 1.6.30-1
    libtiff:          4.0.8-h90200ff_9      --> 4.0.6-3
    libxml2:          2.9.4-h6b072ca_5      --> 2.9.4-0
    libxslt:          1.1.29-hcf9102b_5     --> 1.1.29-0
    matplotlib:       2.1.0-py36hba5de38_0  --> 2.0.2-np113py36_0
    pango:            1.40.11-h8191d47_0    --> 1.40.3-1
    pcre:             8.41-hc71a17e_0       --> 8.39-1
    pycurl:           7.43.0-py36h5e72054_3 --> 7.43.0-py36_2
    pyqt:             5.6.0-py36h0386399_5  --> 5.6.0-py36_2
    pytables:         3.4.2-py36h3b5282a_2  --> 3.4.2-np113py36_0
    python:           3.6.3-hc9025b9_1      --> 3.6.2-0
    qt:               5.6.2-h974d657_12     --> 5.6.2-5
    readline:         7.0-hac23ff0_3        --> 6.2-2
    sqlite:           3.20.1-h6d8b0f3_1     --> 3.13.0-0
    tk:               8.6.7-h5979e9b_1      --> 8.5.18-0
    zlib:             1.2.11-hfbfcf68_1     --> 1.2.8-3
```

----
So, basically `conda 4.4.x` has a problem with "orphan" packages that don't have their specs in `conda-meta/history`.
The first reproducer installs `fontconfig`, a package that depends on `libpng` and `libxml2` which both depends on `zlib` (`>=1.2.11` for the versions being installed).
If `fontconfig` is installed, `libpng` and `libxml2` remain in the environment but don't have any specs about themselves in `history`. If we now try to install a `zlib <1.2.11`, we get
```
UnsatisfiableError: The following specifications were found to be in conflict:
  - libxml2 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
```
. Interestingly this only happens if we have at least two packages depending on `zlib`. If we remove either of `libpng` or `libxml2`, the packages get downgraded as expected.
The second reproducer shows that this could be a quite common case for `anaconda` users. If you install `anaconda=5.0.1` this will also install `conda=4.3.30` (due to `pycosat` being downgraded, I think). Now, `conda 4.3.x` doesn't seem to update the specs for `anaconda` when `anaconda=5.0.1` gets replaced by `anaconda=custom` (so, that one is a bug in `conda <4.4`!). If we have updated to `conda 4.4.x`, the history still has the `anaconda=5.0.1` and thus a `zlib <1.2.11` install will fail as it would imply package downgrades and thus `anaconda=custom`.
The last commands of the reproducer show that if you install `anaconda=custom`, everything works as expected since the prior conflict is resolved. Now, if you uninstall `anaconda`, you have the same case as with the first reproducer with `fontconfig`: The remaining packages are not (transitively) associated with any specs in `history`. If you reinstall `anaconda`, then again, order is restored.
The `anaconda` related issue was reported in https://github.com/bioconda/bioconda-recipes/issues/7202.
This bug appears not to have been fully fixed. I just encountered it when upgrading from 4.2 -> 4.5.1

```
Solving environment: failed

CondaValueError: Invalid MatchSpec: <4.0
```

It took some digging, but I found the offending line:

```
# install specs: python>=3.5.1,jupyter >=1.0.0,<2.0,matplotlib >=1.5.1,<2.0,numpy >=1.11.0,<2.0,pandas >=0.19.2,<1.0,psycopg2 >=2.6.1,<3.0,pyyaml >=3.12,<4.0,scipy >=0.17.0,<1.0
```
I have just seen the same issue with 4.5.1.
Can you either attach here or email to me (kfranz at anaconda com) the file

    /scratch/mc3/conda-meta/history
@nehaljwani figured out the problem, and the fix to get me up and running again was very easy.

When I'd previously installed a dependency using an awkward specification, conda 4.3 wrote an entry to conda-meta/history that causes conda 4.4 to fail.

The following command
```
$ which conda
/scratch/mc3/bin/conda
$ conda --version
conda 4.3.31
$ conda install -c conda-forge "param>=1.5.1,<2.0"
```

results in the following entry in /scratch/mc3/conda-meta/history:
```
# cmd: /scratch/mc3/bin/conda install -c conda-forge param>=1.5.1,<2.0
[...]
# install specs: param >=1.5.1,<2.0
```

That entry causes no problems for conda 4.3. However, after updating to conda 4.4, there's a problem:

```
$ conda --version
conda 4.4.7
$ conda install numpy
Solving environment: failed

CondaValueError: Invalid MatchSpec: <2.0
```

Fortunately, removing the `install specs` line in /scratch/mc3/conda-meta/history makes the problem go away.

Conda 4.4 writes the history information differently (quoting the matchspec). The following command:
```
$ conda --version
conda 4.4.7
$ conda install -c conda-forge "param>=1.5.1,<2.0"
```

appears in /scratch/mc3/conda-meta/history as:
```
# cmd: /scratch/mc3/bin/conda install -c conda-forge param>=1.5.1,<2.0
[...]
# update specs: ["param[version='>=1.5.1,<2.0']"]
```
I think this is a bug that we should try to write a test for and solve.
Ah, I meant to write an issue for this one some time ago but didn't -- and didn't see this one!
Reproducers:

----

```bash
export CONDA_ALWAYS_YES=1
source bin/activate
conda --version
cconda() {  # run conda commands with concise output
    echo
    echo '>'conda "${@}"
    conda "$1" -q "${@:2}" |\
       sed -n '/INSTALLED\|UPDATED\|DOWNGRADED\|REMOVED/,${/ done$/ba;H;:a};${x;p}'
}
cconda create -nz fontconfig
source activate z
cconda remove fontconfig freetype
cd envs
cat z/conda-meta/history
mv z z-base
mkdir z

test-case() {
    printf '%99s\n' | tr ' ' =
    mkdir z-top z-work
    sudo mount -t overlay overlay -o lowerdir=z-base,upperdir=z-top,workdir=z-work z
    if [[ $# -ne 0 ]] ; then
        "${@}"
        sed -n '/^==>/{h;d};H;${x;p}' z/conda-meta/history
    fi
    cconda install --dry-run 'zlib<1.2.11'
    sudo umount z
    sudo rm -r z-top z-work
}
test-case
test-case cconda install fontconfig
test-case cconda install -f libpng libxml2
test-case cconda install -f libxml2
test-case cconda install -f libpng
test-case cconda remove libpng
test-case cconda remove libxml2

rmdir z
mv z-base z
source deactivate
cconda remove -nz --all
)
```
<details><summary>output:</summary><p>

```
conda 4.4.7

>conda create -nz fontconfig

The following NEW packages will be INSTALLED:

    fontconfig:   2.12.4-h88586e7_1
    freetype:     2.8-hab7d2ae_1
    icu:          58.2-h9c2bf20_1
    libgcc-ng:    7.2.0-h7cc24e2_2
    libpng:       1.6.34-hb9fc6fc_0
    libstdcxx-ng: 7.2.0-h7a57d05_2
    libxml2:      2.9.4-h2e8b1d7_6
    xz:           5.2.3-h55aa19d_2
    zlib:         1.2.11-ha838bed_2


>conda remove fontconfig freetype

The following packages will be REMOVED:

    fontconfig: 2.12.4-h88586e7_1
    freetype:   2.8-hab7d2ae_1

==> 2018-01-24 16:01:04 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda create -q -nz fontconfig
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-hab7d2ae_1
+defaults::icu-58.2-h9c2bf20_1
+defaults::libgcc-ng-7.2.0-h7cc24e2_2
+defaults::libpng-1.6.34-hb9fc6fc_0
+defaults::libstdcxx-ng-7.2.0-h7a57d05_2
+defaults::libxml2-2.9.4-h2e8b1d7_6
+defaults::xz-5.2.3-h55aa19d_2
+defaults::zlib-1.2.11-ha838bed_2
# update specs: ['fontconfig']
==> 2018-01-24 16:01:07 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda remove -q fontconfig freetype
-defaults::fontconfig-2.12.4-h88586e7_1
-defaults::freetype-2.8-hab7d2ae_1
# remove specs: ['freetype', 'fontconfig']
===================================================================================================

>conda install --dry-run zlib<1.2.11

UnsatisfiableError: The following specifications were found to be in conflict:
  - libxml2 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
Use "conda info <package>" to see the dependencies for each package.


===================================================================================================

>conda install fontconfig

The following NEW packages will be INSTALLED:

    fontconfig: 2.12.4-h88586e7_1
    freetype:   2.8-hab7d2ae_1

==> 2018-01-24 16:01:13 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q fontconfig
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-hab7d2ae_1
# update specs: ['fontconfig']

>conda install --dry-run zlib<1.2.11

The following NEW packages will be INSTALLED:

    libiconv:   1.15-h63c8f33_5

The following packages will be DOWNGRADED:

    fontconfig: 2.12.4-h88586e7_1 --> 2.11.1-6
    freetype:   2.8-hab7d2ae_1    --> 2.5.5-2
    libpng:     1.6.34-hb9fc6fc_0 --> 1.6.30-1
    libxml2:    2.9.4-h2e8b1d7_6  --> 2.9.4-0
    zlib:       1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda install -f libpng libxml2

The following packages will be UPDATED:

    libpng:  1.6.34-hb9fc6fc_0 --> 1.6.34-hb9fc6fc_0
    libxml2: 2.9.4-h2e8b1d7_6  --> 2.9.4-h2e8b1d7_6

==> 2018-01-24 16:01:22 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q -f libpng libxml2
# update specs: ['libpng', 'libxml2']

>conda install --dry-run zlib<1.2.11

The following NEW packages will be INSTALLED:

    libiconv: 1.15-h63c8f33_5

The following packages will be DOWNGRADED:

    libpng:   1.6.34-hb9fc6fc_0 --> 1.6.30-1
    libxml2:  2.9.4-h2e8b1d7_6  --> 2.9.4-0
    zlib:     1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda install -f libxml2

The following packages will be UPDATED:

    libxml2: 2.9.4-h2e8b1d7_6 --> 2.9.4-h2e8b1d7_6

==> 2018-01-24 16:01:28 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q -f libxml2
# update specs: ['libxml2']

>conda install --dry-run zlib<1.2.11

The following NEW packages will be INSTALLED:

    libiconv: 1.15-h63c8f33_5

The following packages will be REMOVED:

    libpng:   1.6.34-hb9fc6fc_0

The following packages will be DOWNGRADED:

    libxml2:  2.9.4-h2e8b1d7_6  --> 2.9.4-0
    zlib:     1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda install -f libpng

The following packages will be UPDATED:

    libpng: 1.6.34-hb9fc6fc_0 --> 1.6.34-hb9fc6fc_0

==> 2018-01-24 16:01:34 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda install -q -f libpng
# update specs: ['libpng']

>conda install --dry-run zlib<1.2.11

The following packages will be REMOVED:

    libxml2: 2.9.4-h2e8b1d7_6

The following packages will be DOWNGRADED:

    libpng:  1.6.34-hb9fc6fc_0 --> 1.6.30-1
    zlib:    1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda remove libpng

The following packages will be REMOVED:

    libpng: 1.6.34-hb9fc6fc_0

==> 2018-01-24 16:01:40 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda remove -q libpng
-defaults::libpng-1.6.34-hb9fc6fc_0
# remove specs: ['libpng']

>conda install --dry-run zlib<1.2.11

The following packages will be REMOVED:

    libxml2: 2.9.4-h2e8b1d7_6

The following packages will be DOWNGRADED:

    zlib:    1.2.11-ha838bed_2 --> 1.2.8-3

===================================================================================================

>conda remove libxml2

The following packages will be REMOVED:

    libxml2: 2.9.4-h2e8b1d7_6

==> 2018-01-24 16:01:46 <==
# cmd: /home/maba/code/conda/conda-4.4/bin/conda remove -q libxml2
-defaults::libxml2-2.9.4-h2e8b1d7_6
# remove specs: ['libxml2']

>conda install --dry-run zlib<1.2.11

The following packages will be REMOVED:

    libpng: 1.6.34-hb9fc6fc_0

The following packages will be DOWNGRADED:

    zlib:   1.2.11-ha838bed_2 --> 1.2.8-3


>conda remove -nz --all

Remove all packages in environment /home/maba/code/conda/conda-4.4/envs/z:

```
</p></details>
[EDIT: fixed copy-pasta error]

----

```bash
_TMPDIR=$(mktemp -d) ; (
set -x
show-latest-history() { sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history ; }
try-dry-run-install() { conda install -q --dry-run 'zlib<1.2.11' ; }
export CONDA_ALWAYS_YES=1
export CONDA_AUTO_UPDATE_CONDA=0
export CONDA__AGGRESSIVE_UPDATE_PACKAGES=none
cd $_TMPDIR
bash ~/code/conda/Anaconda3-5.0.1-Linux-x86_64.sh -bfp . >/dev/null
source bin/activate 2>/dev/null
alias conda=bin/conda  # use conda directly <- less clutter with "set -x"

conda update -q conda
cat conda-meta/history
try-dry-run-install
CONDA_PINNED_PACKAGES=anaconda=custom conda install -qf anaconda
show-latest-history
try-dry-run-install
conda remove -q anaconda
show-latest-history
try-dry-run-install
conda install -q anaconda=custom
show-latest-history
try-dry-run-install
) ; rm -r $_TMPDIR
```
<details><summary>output:</summary><p>

```
+ export CONDA_ALWAYS_YES=1
+ CONDA_ALWAYS_YES=1
+ export CONDA_AUTO_UPDATE_CONDA=0
+ CONDA_AUTO_UPDATE_CONDA=0
+ export CONDA__AGGRESSIVE_UPDATE_PACKAGES=none
+ CONDA__AGGRESSIVE_UPDATE_PACKAGES=none
+ cd /tmp/tmp.q7Mg5Cd6hm
+ bash /home/maba/code/conda/Anaconda3-5.0.1-Linux-x86_64.sh -bfp .
Python 3.6.3 :: Anaconda, Inc.
+ source bin/activate
+ alias conda=bin/conda
+ conda update -q conda


Package plan for installation in environment /tmp/tmp.q7Mg5Cd6hm:

The following packages will be UPDATED:

    anaconda: 5.0.1-py36hd30a520_1  --> custom-py36hbbc8b67_0
    conda:    4.3.30-py36h5d9f9f4_0 --> 4.4.7-py36_0
    pycosat:  0.6.2-py36h1a0ea17_1  --> 0.6.3-py36h0a5515d_0

+ cat conda-meta/history
==> 2018-01-24 16:03:01 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda update -q conda
+defaults::_ipyw_jlab_nb_ext_conf-0.1.0-py36he11e457_0
+defaults::alabaster-0.7.10-py36h306e16b_0
+defaults::anaconda-5.0.1-py36hd30a520_1
+defaults::anaconda-client-1.6.5-py36h19c0dcd_0
+defaults::anaconda-navigator-1.6.9-py36h11ddaaa_0
+defaults::anaconda-project-0.8.0-py36h29abdf5_0
+defaults::asn1crypto-0.22.0-py36h265ca7c_1
+defaults::astroid-1.5.3-py36hbdb9df2_0
+defaults::astropy-2.0.2-py36ha51211e_4
+defaults::babel-2.5.0-py36h7d14adf_0
+defaults::backports-1.0-py36hfa02d7e_1
+defaults::backports.shutil_get_terminal_size-1.0.0-py36hfea85ff_2
+defaults::beautifulsoup4-4.6.0-py36h49b8c8c_1
+defaults::bitarray-0.8.1-py36h5834eb8_0
+defaults::bkcharts-0.2-py36h735825a_0
+defaults::blaze-0.11.3-py36h4e06776_0
+defaults::bleach-2.0.0-py36h688b259_0
+defaults::bokeh-0.12.10-py36hbb0e44a_0
+defaults::boto-2.48.0-py36h6e4cd66_1
+defaults::bottleneck-1.2.1-py36haac1ea0_0
+defaults::bzip2-1.0.6-h0376d23_1
+defaults::ca-certificates-2017.08.26-h1d4fec5_0
+defaults::cairo-1.14.10-haa5651f_5
+defaults::certifi-2017.7.27.1-py36h8b7b77e_0
+defaults::cffi-1.10.0-py36had8d393_1
+defaults::chardet-3.0.4-py36h0f667ec_1
+defaults::click-6.7-py36h5253387_0
+defaults::cloudpickle-0.4.0-py36h30f8c20_0
+defaults::clyent-1.2.2-py36h7e57e65_1
+defaults::colorama-0.3.9-py36h489cec4_0
+defaults::conda-4.3.30-py36h5d9f9f4_0
+defaults::conda-build-3.0.27-py36h940a66d_0
+defaults::conda-env-2.6.0-h36134e3_1
+defaults::conda-verify-2.0.0-py36h98955d8_0
+defaults::contextlib2-0.5.5-py36h6c84a62_0
+defaults::cryptography-2.0.3-py36ha225213_1
+defaults::curl-7.55.1-hcb0b314_2
+defaults::cycler-0.10.0-py36h93f1223_0
+defaults::cython-0.26.1-py36h21c49d0_0
+defaults::cytoolz-0.8.2-py36h708bfd4_0
+defaults::dask-0.15.3-py36hdc2c8aa_0
+defaults::dask-core-0.15.3-py36h10e6167_0
+defaults::datashape-0.5.4-py36h3ad6b5c_0
+defaults::dbus-1.10.22-h3b5a359_0
+defaults::decorator-4.1.2-py36hd076ac8_0
+defaults::distributed-1.19.1-py36h25f3894_0
+defaults::docutils-0.14-py36hb0f60f5_0
+defaults::entrypoints-0.2.3-py36h1aec115_2
+defaults::et_xmlfile-1.0.1-py36hd6bccc3_0
+defaults::expat-2.2.4-hc00ebd1_1
+defaults::fastcache-1.0.2-py36h5b0c431_0
+defaults::filelock-2.0.12-py36hacfa1f5_0
+defaults::flask-0.12.2-py36hb24657c_0
+defaults::flask-cors-3.0.3-py36h2d857d3_0
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-h52ed37b_0
+defaults::get_terminal_size-1.0.0-haa9412d_0
+defaults::gevent-1.2.2-py36h2fe25dc_0
+defaults::glib-2.53.6-hc861d11_1
+defaults::glob2-0.5-py36h2c1b292_1
+defaults::gmp-6.1.2-hb3b607b_0
+defaults::gmpy2-2.0.8-py36h55090d7_1
+defaults::graphite2-1.3.10-hc526e54_0
+defaults::greenlet-0.4.12-py36h2d503a6_0
+defaults::gst-plugins-base-1.12.2-he3457e5_0
+defaults::gstreamer-1.12.2-h4f93127_0
+defaults::h5py-2.7.0-py36he81ebca_1
+defaults::harfbuzz-1.5.0-h2545bd6_0
+defaults::hdf5-1.10.1-hb0523eb_0
+defaults::heapdict-1.0.0-py36h79797d7_0
+defaults::html5lib-0.999999999-py36h2cfc398_0
+defaults::icu-58.2-h211956c_0
+defaults::idna-2.6-py36h82fb2a8_1
+defaults::imageio-2.2.0-py36he555465_0
+defaults::imagesize-0.7.1-py36h52d8127_0
+defaults::intel-openmp-2018.0.0-h15fc484_7
+defaults::ipykernel-4.6.1-py36hbf841aa_0
+defaults::ipython-6.1.0-py36hc72a948_1
+defaults::ipython_genutils-0.2.0-py36hb52b0d5_0
+defaults::ipywidgets-7.0.0-py36h7b55c3a_0
+defaults::isort-4.2.15-py36had401c0_0
+defaults::itsdangerous-0.24-py36h93cc618_1
+defaults::jbig-2.1-hdba287a_0
+defaults::jdcal-1.3-py36h4c697fb_0
+defaults::jedi-0.10.2-py36h552def0_0
+defaults::jinja2-2.9.6-py36h489bce4_1
+defaults::jpeg-9b-habf39ab_1
+defaults::jsonschema-2.6.0-py36h006f8b5_0
+defaults::jupyter-1.0.0-py36h9896ce5_0
+defaults::jupyter_client-5.1.0-py36h614e9ea_0
+defaults::jupyter_console-5.2.0-py36he59e554_1
+defaults::jupyter_core-4.3.0-py36h357a921_0
+defaults::jupyterlab-0.27.0-py36h86377d0_2
+defaults::jupyterlab_launcher-0.4.0-py36h4d8058d_0
+defaults::lazy-object-proxy-1.3.1-py36h10fcdad_0
+defaults::libedit-3.1-heed3624_0
+defaults::libffi-3.2.1-h4deb6c0_3
+defaults::libgcc-ng-7.2.0-h7cc24e2_2
+defaults::libgfortran-ng-7.2.0-h9f7466a_2
+defaults::libpng-1.6.32-hda9c8bc_2
+defaults::libsodium-1.0.13-h31c71d8_2
+defaults::libssh2-1.8.0-h8c220ad_2
+defaults::libstdcxx-ng-7.2.0-h7a57d05_2
+defaults::libtiff-4.0.8-h90200ff_9
+defaults::libtool-2.4.6-hd50d1a6_0
+defaults::libxcb-1.12-h84ff03f_3
+defaults::libxml2-2.9.4-h6b072ca_5
+defaults::libxslt-1.1.29-hcf9102b_5
+defaults::llvmlite-0.20.0-py36_0
+defaults::locket-0.2.0-py36h787c0ad_1
+defaults::lxml-4.1.0-py36h5b66e50_0
+defaults::lzo-2.10-h1bfc0ba_1
+defaults::markupsafe-1.0-py36hd9260cd_1
+defaults::matplotlib-2.1.0-py36hba5de38_0
+defaults::mccabe-0.6.1-py36h5ad9710_1
+defaults::mistune-0.7.4-py36hbab8784_0
+defaults::mkl-2018.0.0-hb491cac_4
+defaults::mkl-service-1.1.2-py36h17a0993_4
+defaults::mpc-1.0.3-hf803216_4
+defaults::mpfr-3.1.5-h12ff648_1
+defaults::mpmath-0.19-py36h8cc018b_2
+defaults::msgpack-python-0.4.8-py36hec4c5d1_0
+defaults::multipledispatch-0.4.9-py36h41da3fb_0
+defaults::navigator-updater-0.1.0-py36h14770f7_0
+defaults::nbconvert-5.3.1-py36hb41ffb7_0
+defaults::nbformat-4.4.0-py36h31c9010_0
+defaults::ncurses-6.0-h06874d7_1
+defaults::networkx-2.0-py36h7e96fb8_0
+defaults::nltk-3.2.4-py36h1a0979f_0
+defaults::nose-1.3.7-py36hcdf7029_2
+defaults::notebook-5.0.0-py36h0b20546_2
+defaults::numba-0.35.0-np113py36_10
+defaults::numexpr-2.6.2-py36hdd3393f_1
+defaults::numpy-1.13.3-py36ha12f23b_0
+defaults::numpydoc-0.7.0-py36h18f165f_0
+defaults::odo-0.5.1-py36h90ed295_0
+defaults::olefile-0.44-py36h79f9f78_0
+defaults::openpyxl-2.4.8-py36h41dd2a8_1
+defaults::openssl-1.0.2l-h077ae2c_5
+defaults::packaging-16.8-py36ha668100_1
+defaults::pandas-0.20.3-py36h842e28d_2
+defaults::pandoc-1.19.2.1-hea2e7c5_1
+defaults::pandocfilters-1.4.2-py36ha6701b7_1
+defaults::pango-1.40.11-h8191d47_0
+defaults::partd-0.3.8-py36h36fd896_0
+defaults::patchelf-0.9-hf79760b_2
+defaults::path.py-10.3.1-py36he0c6f6d_0
+defaults::pathlib2-2.3.0-py36h49efa8e_0
+defaults::patsy-0.4.1-py36ha3be15e_0
+defaults::pcre-8.41-hc71a17e_0
+defaults::pep8-1.7.0-py36h26ade29_0
+defaults::pexpect-4.2.1-py36h3b9d41b_0
+defaults::pickleshare-0.7.4-py36h63277f8_0
+defaults::pillow-4.2.1-py36h9119f52_0
+defaults::pip-9.0.1-py36h8ec8b28_3
+defaults::pixman-0.34.0-h83dc358_2
+defaults::pkginfo-1.4.1-py36h215d178_1
+defaults::ply-3.10-py36hed35086_0
+defaults::prompt_toolkit-1.0.15-py36h17d85b1_0
+defaults::psutil-5.4.0-py36h84c53db_0
+defaults::ptyprocess-0.5.2-py36h69acd42_0
+defaults::py-1.4.34-py36h0712aa3_1
+defaults::pycodestyle-2.3.1-py36hf609f19_0
+defaults::pycosat-0.6.2-py36h1a0ea17_1
+defaults::pycparser-2.18-py36hf9f622e_1
+defaults::pycrypto-2.6.1-py36h6998063_1
+defaults::pycurl-7.43.0-py36h5e72054_3
+defaults::pyflakes-1.6.0-py36h7bd6a15_0
+defaults::pygments-2.2.0-py36h0d3125c_0
+defaults::pylint-1.7.4-py36hb9d4533_0
+defaults::pyodbc-4.0.17-py36h999153c_0
+defaults::pyopenssl-17.2.0-py36h5cc804b_0
+defaults::pyparsing-2.2.0-py36hee85983_1
+defaults::pyqt-5.6.0-py36h0386399_5
+defaults::pysocks-1.6.7-py36hd97a5b1_1
+defaults::pytables-3.4.2-py36h3b5282a_2
+defaults::pytest-3.2.1-py36h11ad3bb_1
+defaults::python-3.6.3-hc9025b9_1
+defaults::python-dateutil-2.6.1-py36h88d3b88_1
+defaults::pytz-2017.2-py36hc2ccc2a_1
+defaults::pywavelets-0.5.2-py36he602eb0_0
+defaults::pyyaml-3.12-py36hafb9ca4_1
+defaults::pyzmq-16.0.2-py36h3b0cf96_2
+defaults::qt-5.6.2-h974d657_12
+defaults::qtawesome-0.4.4-py36h609ed8c_0
+defaults::qtconsole-4.3.1-py36h8f73b5b_0
+defaults::qtpy-1.3.1-py36h3691cc8_0
+defaults::readline-7.0-hac23ff0_3
+defaults::requests-2.18.4-py36he2e5f8d_1
+defaults::rope-0.10.5-py36h1f8c17e_0
+defaults::ruamel_yaml-0.11.14-py36ha2fb22d_2
+defaults::scikit-image-0.13.0-py36had3c07a_1
+defaults::scikit-learn-0.19.1-py36h7aa7ec6_0
+defaults::scipy-0.19.1-py36h9976243_3
+defaults::seaborn-0.8.0-py36h197244f_0
+defaults::setuptools-36.5.0-py36he42e2e1_0
+defaults::simplegeneric-0.8.1-py36h2cb9092_0
+defaults::singledispatch-3.4.0.3-py36h7a266c3_0
+defaults::sip-4.18.1-py36h51ed4ed_2
+defaults::six-1.11.0-py36h372c433_1
+defaults::snowballstemmer-1.2.1-py36h6febd40_0
+defaults::sortedcollections-0.5.3-py36h3c761f9_0
+defaults::sortedcontainers-1.5.7-py36hdf89491_0
+defaults::sphinx-1.6.3-py36he5f0bdb_0
+defaults::sphinxcontrib-1.0-py36h6d0f590_1
+defaults::sphinxcontrib-websupport-1.0.1-py36hb5cb234_1
+defaults::spyder-3.2.4-py36hbe6152b_0
+defaults::sqlalchemy-1.1.13-py36hfb5efd7_0
+defaults::sqlite-3.20.1-h6d8b0f3_1
+defaults::statsmodels-0.8.0-py36h8533d0b_0
+defaults::sympy-1.1.1-py36hc6d1c1c_0
+defaults::tblib-1.3.2-py36h34cf8b6_0
+defaults::terminado-0.6-py36ha25a19f_0
+defaults::testpath-0.3.1-py36h8cadb63_0
+defaults::tk-8.6.7-h5979e9b_1
+defaults::toolz-0.8.2-py36h81f2dff_0
+defaults::tornado-4.5.2-py36h1283b2a_0
+defaults::traitlets-4.3.2-py36h674d592_0
+defaults::typing-3.6.2-py36h7da032a_0
+defaults::unicodecsv-0.14.1-py36ha668878_0
+defaults::unixodbc-2.3.4-hc36303a_1
+defaults::urllib3-1.22-py36hbe7ace6_0
+defaults::wcwidth-0.1.7-py36hdf4376a_0
+defaults::webencodings-0.5.1-py36h800622e_1
+defaults::werkzeug-0.12.2-py36hc703753_0
+defaults::wheel-0.29.0-py36he7f4e38_1
+defaults::widgetsnbextension-3.0.2-py36hd01bb71_1
+defaults::wrapt-1.10.11-py36h28b7045_0
+defaults::xlrd-1.1.0-py36h1db9f0c_1
+defaults::xlsxwriter-1.0.2-py36h3de1aca_0
+defaults::xlwt-1.3.0-py36h7b00a1f_0
+defaults::xz-5.2.3-h2bcbf08_1
+defaults::yaml-0.1.7-h96e3832_1
+defaults::zeromq-4.2.2-hb0b69da_1
+defaults::zict-0.1.3-py36h3a3bf81_0
+defaults::zlib-1.2.11-hfbfcf68_1
==> 2018-01-24 16:03:02 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda update -q conda
-defaults::anaconda-5.0.1-py36hd30a520_1
-defaults::conda-4.3.30-py36h5d9f9f4_0
-defaults::pycosat-0.6.2-py36h1a0ea17_1
+defaults::anaconda-custom-py36hbbc8b67_0
+defaults::conda-4.4.7-py36_0
+defaults::pycosat-0.6.3-py36h0a5515d_0
# update specs: conda
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - hdf5 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
Use "conda info <package>" to see the dependencies for each package.

+ CONDA_PINNED_PACKAGES=anaconda=custom
+ conda install -qf anaconda
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - anaconda


The following packages will be DOWNGRADED:

    anaconda: custom-py36hbbc8b67_0 --> custom-py36hbbc8b67_0

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
+ show-latest-history
+ sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history
==> 2018-01-24 16:04:21 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda install -qf anaconda
# update specs: ['anaconda']
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - zlib[version='<1.2.11']


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    readline-6.2               |                2         606 KB
    sqlite-3.13.0              |                0         4.0 MB
    libxslt-1.1.29             |                0         983 KB
    tk-8.5.18                  |                0         1.9 MB
    fontconfig-2.12.1          |                3         429 KB
    python-3.6.2               |                0        16.5 MB
    freetype-2.5.5             |                2         2.5 MB
    pillow-4.2.1               |           py36_0         870 KB
    libxml2-2.9.4              |                0         3.7 MB
    dbus-1.10.20               |                0         1.4 MB
    harfbuzz-0.9.39            |                2         1.2 MB
    hdf5-1.8.17                |                2         2.0 MB
    pango-1.40.3               |                1         938 KB
    pcre-8.39                  |                1         656 KB
    qt-5.6.2                   |                5        43.5 MB
    curl-7.52.1                |                0         558 KB
    pycurl-7.43.0              |           py36_2         139 KB
    gstreamer-1.8.0            |                0         2.6 MB
    libtiff-4.0.6              |                3         1.5 MB
    pyqt-5.6.0                 |           py36_2         5.4 MB
    libpng-1.6.30              |                1         220 KB
    icu-54.1                   |                0        11.3 MB
    glib-2.50.2                |                1         5.6 MB
    h5py-2.7.0                 |      np113py36_0         2.9 MB
    libiconv-1.14              |                0         2.0 MB
    gst-plugins-base-1.8.0     |                0         3.1 MB
    cairo-1.14.8               |                0         609 KB
    matplotlib-2.0.2           |      np113py36_0        10.9 MB
    libgcc-7.2.0               |       h69d50b8_2         304 KB
    zlib-1.2.8                 |                3         101 KB
    pytables-3.4.2             |      np113py36_0         6.1 MB
    ------------------------------------------------------------
                                           Total:       134.1 MB

The following NEW packages will be INSTALLED:

    libgcc:           7.2.0-h69d50b8_2
    libiconv:         1.14-0

The following packages will be UPDATED:

    pillow:           4.2.1-py36h9119f52_0  --> 4.2.1-py36_0

The following packages will be DOWNGRADED:

    cairo:            1.14.10-haa5651f_5    --> 1.14.8-0
    curl:             7.55.1-hcb0b314_2     --> 7.52.1-0
    dbus:             1.10.22-h3b5a359_0    --> 1.10.20-0
    fontconfig:       2.12.4-h88586e7_1     --> 2.12.1-3
    freetype:         2.8-h52ed37b_0        --> 2.5.5-2
    glib:             2.53.6-hc861d11_1     --> 2.50.2-1
    gst-plugins-base: 1.12.2-he3457e5_0     --> 1.8.0-0
    gstreamer:        1.12.2-h4f93127_0     --> 1.8.0-0
    h5py:             2.7.0-py36he81ebca_1  --> 2.7.0-np113py36_0
    harfbuzz:         1.5.0-h2545bd6_0      --> 0.9.39-2
    hdf5:             1.10.1-hb0523eb_0     --> 1.8.17-2
    icu:              58.2-h211956c_0       --> 54.1-0
    libpng:           1.6.32-hda9c8bc_2     --> 1.6.30-1
    libtiff:          4.0.8-h90200ff_9      --> 4.0.6-3
    libxml2:          2.9.4-h6b072ca_5      --> 2.9.4-0
    libxslt:          1.1.29-hcf9102b_5     --> 1.1.29-0
    matplotlib:       2.1.0-py36hba5de38_0  --> 2.0.2-np113py36_0
    pango:            1.40.11-h8191d47_0    --> 1.40.3-1
    pcre:             8.41-hc71a17e_0       --> 8.39-1
    pycurl:           7.43.0-py36h5e72054_3 --> 7.43.0-py36_2
    pyqt:             5.6.0-py36h0386399_5  --> 5.6.0-py36_2
    pytables:         3.4.2-py36h3b5282a_2  --> 3.4.2-np113py36_0
    python:           3.6.3-hc9025b9_1      --> 3.6.2-0
    qt:               5.6.2-h974d657_12     --> 5.6.2-5
    readline:         7.0-hac23ff0_3        --> 6.2-2
    sqlite:           3.20.1-h6d8b0f3_1     --> 3.13.0-0
    tk:               8.6.7-h5979e9b_1      --> 8.5.18-0
    zlib:             1.2.11-hfbfcf68_1     --> 1.2.8-3

+ conda remove -q anaconda
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  removed specs:
    - anaconda


The following packages will be REMOVED:

    anaconda: custom-py36hbbc8b67_0

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
+ show-latest-history
+ sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history
==> 2018-01-24 16:05:34 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda remove -q anaconda
+defaults::_ipyw_jlab_nb_ext_conf-0.1.0-py36he11e457_0
+defaults::alabaster-0.7.10-py36h306e16b_0
+defaults::anaconda-client-1.6.5-py36h19c0dcd_0
+defaults::anaconda-navigator-1.6.9-py36h11ddaaa_0
+defaults::anaconda-project-0.8.0-py36h29abdf5_0
+defaults::asn1crypto-0.22.0-py36h265ca7c_1
+defaults::astroid-1.5.3-py36hbdb9df2_0
+defaults::astropy-2.0.2-py36ha51211e_4
+defaults::babel-2.5.0-py36h7d14adf_0
+defaults::backports-1.0-py36hfa02d7e_1
+defaults::backports.shutil_get_terminal_size-1.0.0-py36hfea85ff_2
+defaults::beautifulsoup4-4.6.0-py36h49b8c8c_1
+defaults::bitarray-0.8.1-py36h5834eb8_0
+defaults::bkcharts-0.2-py36h735825a_0
+defaults::blaze-0.11.3-py36h4e06776_0
+defaults::bleach-2.0.0-py36h688b259_0
+defaults::bokeh-0.12.10-py36hbb0e44a_0
+defaults::boto-2.48.0-py36h6e4cd66_1
+defaults::bottleneck-1.2.1-py36haac1ea0_0
+defaults::bzip2-1.0.6-h0376d23_1
+defaults::ca-certificates-2017.08.26-h1d4fec5_0
+defaults::cairo-1.14.10-haa5651f_5
+defaults::certifi-2017.7.27.1-py36h8b7b77e_0
+defaults::cffi-1.10.0-py36had8d393_1
+defaults::chardet-3.0.4-py36h0f667ec_1
+defaults::click-6.7-py36h5253387_0
+defaults::cloudpickle-0.4.0-py36h30f8c20_0
+defaults::clyent-1.2.2-py36h7e57e65_1
+defaults::colorama-0.3.9-py36h489cec4_0
+defaults::conda-4.4.7-py36_0
+defaults::conda-build-3.0.27-py36h940a66d_0
+defaults::conda-env-2.6.0-h36134e3_1
+defaults::conda-verify-2.0.0-py36h98955d8_0
+defaults::contextlib2-0.5.5-py36h6c84a62_0
+defaults::cryptography-2.0.3-py36ha225213_1
+defaults::curl-7.55.1-hcb0b314_2
+defaults::cycler-0.10.0-py36h93f1223_0
+defaults::cython-0.26.1-py36h21c49d0_0
+defaults::cytoolz-0.8.2-py36h708bfd4_0
+defaults::dask-0.15.3-py36hdc2c8aa_0
+defaults::dask-core-0.15.3-py36h10e6167_0
+defaults::datashape-0.5.4-py36h3ad6b5c_0
+defaults::dbus-1.10.22-h3b5a359_0
+defaults::decorator-4.1.2-py36hd076ac8_0
+defaults::distributed-1.19.1-py36h25f3894_0
+defaults::docutils-0.14-py36hb0f60f5_0
+defaults::entrypoints-0.2.3-py36h1aec115_2
+defaults::et_xmlfile-1.0.1-py36hd6bccc3_0
+defaults::expat-2.2.4-hc00ebd1_1
+defaults::fastcache-1.0.2-py36h5b0c431_0
+defaults::filelock-2.0.12-py36hacfa1f5_0
+defaults::flask-0.12.2-py36hb24657c_0
+defaults::flask-cors-3.0.3-py36h2d857d3_0
+defaults::fontconfig-2.12.4-h88586e7_1
+defaults::freetype-2.8-h52ed37b_0
+defaults::get_terminal_size-1.0.0-haa9412d_0
+defaults::gevent-1.2.2-py36h2fe25dc_0
+defaults::glib-2.53.6-hc861d11_1
+defaults::glob2-0.5-py36h2c1b292_1
+defaults::gmp-6.1.2-hb3b607b_0
+defaults::gmpy2-2.0.8-py36h55090d7_1
+defaults::graphite2-1.3.10-hc526e54_0
+defaults::greenlet-0.4.12-py36h2d503a6_0
+defaults::gst-plugins-base-1.12.2-he3457e5_0
+defaults::gstreamer-1.12.2-h4f93127_0
+defaults::h5py-2.7.0-py36he81ebca_1
+defaults::harfbuzz-1.5.0-h2545bd6_0
+defaults::hdf5-1.10.1-hb0523eb_0
+defaults::heapdict-1.0.0-py36h79797d7_0
+defaults::html5lib-0.999999999-py36h2cfc398_0
+defaults::icu-58.2-h211956c_0
+defaults::idna-2.6-py36h82fb2a8_1
+defaults::imageio-2.2.0-py36he555465_0
+defaults::imagesize-0.7.1-py36h52d8127_0
+defaults::intel-openmp-2018.0.0-h15fc484_7
+defaults::ipykernel-4.6.1-py36hbf841aa_0
+defaults::ipython-6.1.0-py36hc72a948_1
+defaults::ipython_genutils-0.2.0-py36hb52b0d5_0
+defaults::ipywidgets-7.0.0-py36h7b55c3a_0
+defaults::isort-4.2.15-py36had401c0_0
+defaults::itsdangerous-0.24-py36h93cc618_1
+defaults::jbig-2.1-hdba287a_0
+defaults::jdcal-1.3-py36h4c697fb_0
+defaults::jedi-0.10.2-py36h552def0_0
+defaults::jinja2-2.9.6-py36h489bce4_1
+defaults::jpeg-9b-habf39ab_1
+defaults::jsonschema-2.6.0-py36h006f8b5_0
+defaults::jupyter-1.0.0-py36h9896ce5_0
+defaults::jupyter_client-5.1.0-py36h614e9ea_0
+defaults::jupyter_console-5.2.0-py36he59e554_1
+defaults::jupyter_core-4.3.0-py36h357a921_0
+defaults::jupyterlab-0.27.0-py36h86377d0_2
+defaults::jupyterlab_launcher-0.4.0-py36h4d8058d_0
+defaults::lazy-object-proxy-1.3.1-py36h10fcdad_0
+defaults::libedit-3.1-heed3624_0
+defaults::libffi-3.2.1-h4deb6c0_3
+defaults::libgcc-ng-7.2.0-h7cc24e2_2
+defaults::libgfortran-ng-7.2.0-h9f7466a_2
+defaults::libpng-1.6.32-hda9c8bc_2
+defaults::libsodium-1.0.13-h31c71d8_2
+defaults::libssh2-1.8.0-h8c220ad_2
+defaults::libstdcxx-ng-7.2.0-h7a57d05_2
+defaults::libtiff-4.0.8-h90200ff_9
+defaults::libtool-2.4.6-hd50d1a6_0
+defaults::libxcb-1.12-h84ff03f_3
+defaults::libxml2-2.9.4-h6b072ca_5
+defaults::libxslt-1.1.29-hcf9102b_5
+defaults::llvmlite-0.20.0-py36_0
+defaults::locket-0.2.0-py36h787c0ad_1
+defaults::lxml-4.1.0-py36h5b66e50_0
+defaults::lzo-2.10-h1bfc0ba_1
+defaults::markupsafe-1.0-py36hd9260cd_1
+defaults::matplotlib-2.1.0-py36hba5de38_0
+defaults::mccabe-0.6.1-py36h5ad9710_1
+defaults::mistune-0.7.4-py36hbab8784_0
+defaults::mkl-2018.0.0-hb491cac_4
+defaults::mkl-service-1.1.2-py36h17a0993_4
+defaults::mpc-1.0.3-hf803216_4
+defaults::mpfr-3.1.5-h12ff648_1
+defaults::mpmath-0.19-py36h8cc018b_2
+defaults::msgpack-python-0.4.8-py36hec4c5d1_0
+defaults::multipledispatch-0.4.9-py36h41da3fb_0
+defaults::navigator-updater-0.1.0-py36h14770f7_0
+defaults::nbconvert-5.3.1-py36hb41ffb7_0
+defaults::nbformat-4.4.0-py36h31c9010_0
+defaults::ncurses-6.0-h06874d7_1
+defaults::networkx-2.0-py36h7e96fb8_0
+defaults::nltk-3.2.4-py36h1a0979f_0
+defaults::nose-1.3.7-py36hcdf7029_2
+defaults::notebook-5.0.0-py36h0b20546_2
+defaults::numba-0.35.0-np113py36_10
+defaults::numexpr-2.6.2-py36hdd3393f_1
+defaults::numpy-1.13.3-py36ha12f23b_0
+defaults::numpydoc-0.7.0-py36h18f165f_0
+defaults::odo-0.5.1-py36h90ed295_0
+defaults::olefile-0.44-py36h79f9f78_0
+defaults::openpyxl-2.4.8-py36h41dd2a8_1
+defaults::openssl-1.0.2l-h077ae2c_5
+defaults::packaging-16.8-py36ha668100_1
+defaults::pandas-0.20.3-py36h842e28d_2
+defaults::pandoc-1.19.2.1-hea2e7c5_1
+defaults::pandocfilters-1.4.2-py36ha6701b7_1
+defaults::pango-1.40.11-h8191d47_0
+defaults::partd-0.3.8-py36h36fd896_0
+defaults::patchelf-0.9-hf79760b_2
+defaults::path.py-10.3.1-py36he0c6f6d_0
+defaults::pathlib2-2.3.0-py36h49efa8e_0
+defaults::patsy-0.4.1-py36ha3be15e_0
+defaults::pcre-8.41-hc71a17e_0
+defaults::pep8-1.7.0-py36h26ade29_0
+defaults::pexpect-4.2.1-py36h3b9d41b_0
+defaults::pickleshare-0.7.4-py36h63277f8_0
+defaults::pillow-4.2.1-py36h9119f52_0
+defaults::pip-9.0.1-py36h8ec8b28_3
+defaults::pixman-0.34.0-h83dc358_2
+defaults::pkginfo-1.4.1-py36h215d178_1
+defaults::ply-3.10-py36hed35086_0
+defaults::prompt_toolkit-1.0.15-py36h17d85b1_0
+defaults::psutil-5.4.0-py36h84c53db_0
+defaults::ptyprocess-0.5.2-py36h69acd42_0
+defaults::py-1.4.34-py36h0712aa3_1
+defaults::pycodestyle-2.3.1-py36hf609f19_0
+defaults::pycosat-0.6.3-py36h0a5515d_0
+defaults::pycparser-2.18-py36hf9f622e_1
+defaults::pycrypto-2.6.1-py36h6998063_1
+defaults::pycurl-7.43.0-py36h5e72054_3
+defaults::pyflakes-1.6.0-py36h7bd6a15_0
+defaults::pygments-2.2.0-py36h0d3125c_0
+defaults::pylint-1.7.4-py36hb9d4533_0
+defaults::pyodbc-4.0.17-py36h999153c_0
+defaults::pyopenssl-17.2.0-py36h5cc804b_0
+defaults::pyparsing-2.2.0-py36hee85983_1
+defaults::pyqt-5.6.0-py36h0386399_5
+defaults::pysocks-1.6.7-py36hd97a5b1_1
+defaults::pytables-3.4.2-py36h3b5282a_2
+defaults::pytest-3.2.1-py36h11ad3bb_1
+defaults::python-3.6.3-hc9025b9_1
+defaults::python-dateutil-2.6.1-py36h88d3b88_1
+defaults::pytz-2017.2-py36hc2ccc2a_1
+defaults::pywavelets-0.5.2-py36he602eb0_0
+defaults::pyyaml-3.12-py36hafb9ca4_1
+defaults::pyzmq-16.0.2-py36h3b0cf96_2
+defaults::qt-5.6.2-h974d657_12
+defaults::qtawesome-0.4.4-py36h609ed8c_0
+defaults::qtconsole-4.3.1-py36h8f73b5b_0
+defaults::qtpy-1.3.1-py36h3691cc8_0
+defaults::readline-7.0-hac23ff0_3
+defaults::requests-2.18.4-py36he2e5f8d_1
+defaults::rope-0.10.5-py36h1f8c17e_0
+defaults::ruamel_yaml-0.11.14-py36ha2fb22d_2
+defaults::scikit-image-0.13.0-py36had3c07a_1
+defaults::scikit-learn-0.19.1-py36h7aa7ec6_0
+defaults::scipy-0.19.1-py36h9976243_3
+defaults::seaborn-0.8.0-py36h197244f_0
+defaults::setuptools-36.5.0-py36he42e2e1_0
+defaults::simplegeneric-0.8.1-py36h2cb9092_0
+defaults::singledispatch-3.4.0.3-py36h7a266c3_0
+defaults::sip-4.18.1-py36h51ed4ed_2
+defaults::six-1.11.0-py36h372c433_1
+defaults::snowballstemmer-1.2.1-py36h6febd40_0
+defaults::sortedcollections-0.5.3-py36h3c761f9_0
+defaults::sortedcontainers-1.5.7-py36hdf89491_0
+defaults::sphinx-1.6.3-py36he5f0bdb_0
+defaults::sphinxcontrib-1.0-py36h6d0f590_1
+defaults::sphinxcontrib-websupport-1.0.1-py36hb5cb234_1
+defaults::spyder-3.2.4-py36hbe6152b_0
+defaults::sqlalchemy-1.1.13-py36hfb5efd7_0
+defaults::sqlite-3.20.1-h6d8b0f3_1
+defaults::statsmodels-0.8.0-py36h8533d0b_0
+defaults::sympy-1.1.1-py36hc6d1c1c_0
+defaults::tblib-1.3.2-py36h34cf8b6_0
+defaults::terminado-0.6-py36ha25a19f_0
+defaults::testpath-0.3.1-py36h8cadb63_0
+defaults::tk-8.6.7-h5979e9b_1
+defaults::toolz-0.8.2-py36h81f2dff_0
+defaults::tornado-4.5.2-py36h1283b2a_0
+defaults::traitlets-4.3.2-py36h674d592_0
+defaults::typing-3.6.2-py36h7da032a_0
+defaults::unicodecsv-0.14.1-py36ha668878_0
+defaults::unixodbc-2.3.4-hc36303a_1
+defaults::urllib3-1.22-py36hbe7ace6_0
+defaults::wcwidth-0.1.7-py36hdf4376a_0
+defaults::webencodings-0.5.1-py36h800622e_1
+defaults::werkzeug-0.12.2-py36hc703753_0
+defaults::wheel-0.29.0-py36he7f4e38_1
+defaults::widgetsnbextension-3.0.2-py36hd01bb71_1
+defaults::wrapt-1.10.11-py36h28b7045_0
+defaults::xlrd-1.1.0-py36h1db9f0c_1
+defaults::xlsxwriter-1.0.2-py36h3de1aca_0
+defaults::xlwt-1.3.0-py36h7b00a1f_0
+defaults::xz-5.2.3-h2bcbf08_1
+defaults::yaml-0.1.7-h96e3832_1
+defaults::zeromq-4.2.2-hb0b69da_1
+defaults::zict-0.1.3-py36h3a3bf81_0
+defaults::zlib-1.2.11-hfbfcf68_1
# remove specs: ['anaconda']
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - hdf5 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
Use "conda info <package>" to see the dependencies for each package.

+ conda install -q anaconda=custom
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - anaconda=custom


The following NEW packages will be INSTALLED:

    anaconda: custom-py36hbbc8b67_0

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
+ show-latest-history
+ sed -n '/^==>/{h;d};H;${x;p}' conda-meta/history
==> 2018-01-24 16:06:27 <==
# cmd: /tmp/tmp.q7Mg5Cd6hm/bin/conda install -q anaconda=custom
+defaults::anaconda-custom-py36hbbc8b67_0
# update specs: ['anaconda=custom']
+ try-dry-run-install
+ conda install -q --dry-run 'zlib<1.2.11'
Solving environment: ...working... done

## Package Plan ##

  environment location: /tmp/tmp.q7Mg5Cd6hm

  added / updated specs:
    - zlib[version='<1.2.11']


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libxslt-1.1.29             |                0         983 KB
    dbus-1.10.20               |                0         1.4 MB
    glib-2.50.2                |                1         5.6 MB
    libtiff-4.0.6              |                3         1.5 MB
    harfbuzz-0.9.39            |                2         1.2 MB
    qt-5.6.2                   |                5        43.5 MB
    icu-54.1                   |                0        11.3 MB
    h5py-2.7.0                 |      np113py36_0         2.9 MB
    zlib-1.2.8                 |                3         101 KB
    pytables-3.4.2             |      np113py36_0         6.1 MB
    pcre-8.39                  |                1         656 KB
    hdf5-1.8.17                |                2         2.0 MB
    gstreamer-1.8.0            |                0         2.6 MB
    gst-plugins-base-1.8.0     |                0         3.1 MB
    pycurl-7.43.0              |           py36_2         139 KB
    pyqt-5.6.0                 |           py36_2         5.4 MB
    libpng-1.6.30              |                1         220 KB
    pillow-4.2.1               |           py36_0         870 KB
    libiconv-1.14              |                0         2.0 MB
    pango-1.40.3               |                1         938 KB
    tk-8.5.18                  |                0         1.9 MB
    python-3.6.2               |                0        16.5 MB
    freetype-2.5.5             |                2         2.5 MB
    matplotlib-2.0.2           |      np113py36_0        10.9 MB
    cairo-1.14.8               |                0         609 KB
    sqlite-3.13.0              |                0         4.0 MB
    libgcc-7.2.0               |       h69d50b8_2         304 KB
    curl-7.52.1                |                0         558 KB
    libxml2-2.9.4              |                0         3.7 MB
    fontconfig-2.12.1          |                3         429 KB
    readline-6.2               |                2         606 KB
    ------------------------------------------------------------
                                           Total:       134.1 MB

The following NEW packages will be INSTALLED:

    libgcc:           7.2.0-h69d50b8_2
    libiconv:         1.14-0

The following packages will be UPDATED:

    pillow:           4.2.1-py36h9119f52_0  --> 4.2.1-py36_0

The following packages will be DOWNGRADED:

    cairo:            1.14.10-haa5651f_5    --> 1.14.8-0
    curl:             7.55.1-hcb0b314_2     --> 7.52.1-0
    dbus:             1.10.22-h3b5a359_0    --> 1.10.20-0
    fontconfig:       2.12.4-h88586e7_1     --> 2.12.1-3
    freetype:         2.8-h52ed37b_0        --> 2.5.5-2
    glib:             2.53.6-hc861d11_1     --> 2.50.2-1
    gst-plugins-base: 1.12.2-he3457e5_0     --> 1.8.0-0
    gstreamer:        1.12.2-h4f93127_0     --> 1.8.0-0
    h5py:             2.7.0-py36he81ebca_1  --> 2.7.0-np113py36_0
    harfbuzz:         1.5.0-h2545bd6_0      --> 0.9.39-2
    hdf5:             1.10.1-hb0523eb_0     --> 1.8.17-2
    icu:              58.2-h211956c_0       --> 54.1-0
    libpng:           1.6.32-hda9c8bc_2     --> 1.6.30-1
    libtiff:          4.0.8-h90200ff_9      --> 4.0.6-3
    libxml2:          2.9.4-h6b072ca_5      --> 2.9.4-0
    libxslt:          1.1.29-hcf9102b_5     --> 1.1.29-0
    matplotlib:       2.1.0-py36hba5de38_0  --> 2.0.2-np113py36_0
    pango:            1.40.11-h8191d47_0    --> 1.40.3-1
    pcre:             8.41-hc71a17e_0       --> 8.39-1
    pycurl:           7.43.0-py36h5e72054_3 --> 7.43.0-py36_2
    pyqt:             5.6.0-py36h0386399_5  --> 5.6.0-py36_2
    pytables:         3.4.2-py36h3b5282a_2  --> 3.4.2-np113py36_0
    python:           3.6.3-hc9025b9_1      --> 3.6.2-0
    qt:               5.6.2-h974d657_12     --> 5.6.2-5
    readline:         7.0-hac23ff0_3        --> 6.2-2
    sqlite:           3.20.1-h6d8b0f3_1     --> 3.13.0-0
    tk:               8.6.7-h5979e9b_1      --> 8.5.18-0
    zlib:             1.2.11-hfbfcf68_1     --> 1.2.8-3
```

----
So, basically `conda 4.4.x` has a problem with "orphan" packages that don't have their specs in `conda-meta/history`.
The first reproducer installs `fontconfig`, a package that depends on `libpng` and `libxml2` which both depends on `zlib` (`>=1.2.11` for the versions being installed).
If `fontconfig` is installed, `libpng` and `libxml2` remain in the environment but don't have any specs about themselves in `history`. If we now try to install a `zlib <1.2.11`, we get
```
UnsatisfiableError: The following specifications were found to be in conflict:
  - libxml2 -> zlib[version='>=1.2.11,<1.3.0a0']
  - zlib[version='<1.2.11']
```
. Interestingly this only happens if we have at least two packages depending on `zlib`. If we remove either of `libpng` or `libxml2`, the packages get downgraded as expected.
The second reproducer shows that this could be a quite common case for `anaconda` users. If you install `anaconda=5.0.1` this will also install `conda=4.3.30` (due to `pycosat` being downgraded, I think). Now, `conda 4.3.x` doesn't seem to update the specs for `anaconda` when `anaconda=5.0.1` gets replaced by `anaconda=custom` (so, that one is a bug in `conda <4.4`!). If we have updated to `conda 4.4.x`, the history still has the `anaconda=5.0.1` and thus a `zlib <1.2.11` install will fail as it would imply package downgrades and thus `anaconda=custom`.
The last commands of the reproducer show that if you install `anaconda=custom`, everything works as expected since the prior conflict is resolved. Now, if you uninstall `anaconda`, you have the same case as with the first reproducer with `fontconfig`: The remaining packages are not (transitively) associated with any specs in `history`. If you reinstall `anaconda`, then again, order is restored.
The `anaconda` related issue was reported in https://github.com/bioconda/bioconda-recipes/issues/7202.
This bug appears not to have been fully fixed. I just encountered it when upgrading from 4.2 -> 4.5.1

```
Solving environment: failed

CondaValueError: Invalid MatchSpec: <4.0
```

It took some digging, but I found the offending line:

```
# install specs: python>=3.5.1,jupyter >=1.0.0,<2.0,matplotlib >=1.5.1,<2.0,numpy >=1.11.0,<2.0,pandas >=0.19.2,<1.0,psycopg2 >=2.6.1,<3.0,pyyaml >=3.12,<4.0,scipy >=0.17.0,<1.0
```
I have just seen the same issue with 4.5.1.

Resolving patch:
diff --git a/conda/history.py b/conda/history.py
--- a/conda/history.py
+++ b/conda/history.py
@@ -72,6 +72,9 @@ def pretty_content(content):
 
 class History(object):
 
+    com_pat = re.compile(r'#\s*cmd:\s*(.+)')
+    spec_pat = re.compile(r'#\s*(\w+)\s*specs:\s*(.+)?')
+
     def __init__(self, prefix):
         self.prefix = prefix
         self.meta_dir = join(prefix, 'conda-meta')
@@ -133,6 +136,69 @@ def parse(self):
                 res[-1][1].add(line)
         return res
 
+    @staticmethod
+    def _parse_old_format_specs_string(specs_string):
+        """
+        Parse specifications string that use conda<4.5 syntax.
+
+        Examples
+        --------
+          - "param >=1.5.1,<2.0'"
+          - "python>=3.5.1,jupyter >=1.0.0,<2.0,matplotlib >=1.5.1,<2.0"
+        """
+        specs = []
+        for spec in specs_string.split(','):
+            # See https://github.com/conda/conda/issues/6691
+            if spec[0].isalpha():
+                # A valid spec starts with a letter since it is a package name
+                specs.append(spec)
+            else:
+                # Otherwise it is a condition and has to be appended to the
+                # last valid spec on the specs list
+                specs[-1] = ','.join([specs[-1], spec])
+
+        return specs
+
+    @classmethod
+    def _parse_comment_line(cls, line):
+        """
+        Parse comment lines in the history file.
+
+        These lines can be of command type or action type.
+
+        Examples
+        --------
+          - "# cmd: /scratch/mc3/bin/conda install -c conda-forge param>=1.5.1,<2.0"
+          - "# install specs: python>=3.5.1,jupyter >=1.0.0,<2.0,matplotlib >=1.5.1,<2.0"
+        """
+        item = {}
+        m = cls.com_pat.match(line)
+        if m:
+            argv = m.group(1).split()
+            if argv[0].endswith('conda'):
+                argv[0] = 'conda'
+            item['cmd'] = argv
+
+        m = cls.spec_pat.match(line)
+        if m:
+            action, specs_string = m.groups()
+            specs_string = specs_string or ""
+            item['action'] = action
+
+            if specs_string.startswith('['):
+                specs = literal_eval(specs_string)
+            elif '[' not in specs_string:
+                specs = History._parse_old_format_specs_string(specs_string)
+
+            specs = [spec for spec in specs if spec and not spec.endswith('@')]
+
+            if specs and action in ('update', 'install', 'create'):
+                item['update_specs'] = item['specs'] = specs
+            elif specs and action in ('remove', 'uninstall'):
+                item['remove_specs'] = item['specs'] = specs
+
+        return item
+
     def get_user_requests(self):
         """
         return a list of user requested items.  Each item is a dict with the
@@ -143,37 +209,19 @@ def get_user_requests(self):
         'specs': the specs being used
         """
         res = []
-        com_pat = re.compile(r'#\s*cmd:\s*(.+)')
-        spec_pat = re.compile(r'#\s*(\w+)\s*specs:\s*(.+)?')
         for dt, unused_cont, comments in self.parse():
             item = {'date': dt}
             for line in comments:
-                m = com_pat.match(line)
-                if m:
-                    argv = m.group(1).split()
-                    if argv[0].endswith('conda'):
-                        argv[0] = 'conda'
-                    item['cmd'] = argv
-                m = spec_pat.match(line)
-                if m:
-                    action, specs = m.groups()
-                    item['action'] = action
-                    specs = specs or ""
-                    if specs.startswith('['):
-                        specs = literal_eval(specs)
-                    elif '[' not in specs:
-                        specs = specs.split(',')
-                    specs = [spec for spec in specs if spec and not spec.endswith('@')]
-                    if specs and action in ('update', 'install', 'create'):
-                        item['update_specs'] = item['specs'] = specs
-                    elif specs and action in ('remove', 'uninstall'):
-                        item['remove_specs'] = item['specs'] = specs
+                comment_items = self._parse_comment_line(line)
+                item.update(comment_items)
 
             if 'cmd' in item:
                 res.append(item)
+
             dists = groupby(itemgetter(0), unused_cont)
             item['unlink_dists'] = dists.get('-', ())
             item['link_dists'] = dists.get('+', ())
+
         return res
 
     def get_requested_specs_map(self):


Test patch:
diff --git a/tests/test_history.py b/tests/test_history.py
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -6,6 +6,7 @@
 from .test_create import make_temp_prefix
 
 from conda import history
+from conda.resolve import MatchSpec
 
 
 class HistoryTestCase(unittest.TestCase):
@@ -79,3 +80,33 @@ def test_last(self):
                           'unlink_dists': (),
                           'link_dists': ['+pyflakes-1.0.0-py27_0'],
                           })
+
+    def test_conda_comment_version_parsin(self):
+        test_cases = [
+            "# conda version: 4.5.1",
+            "# conda version: 4.5.1rc1",
+            "# conda version: 4.5.1dev0",
+        ]
+        for line in test_cases:
+            item = history.History._parse_comment_line(line)
+            assert not item
+
+    def test_action_command_comment_parsing(self):
+        test_cases = [
+            # New format (>=4.5)
+            "# update specs: [\"param[version='>=1.5.1,<2.0']\"]",
+            # Old format (<4.5)
+            '# install specs: param >=1.5.1,<2.0',
+            '# install specs: python>=3.5.1,jupyter >=1.0.0,<2.0,matplotlib >=1.5.1,<2.0,numpy >=1.11.0,<2.0,pandas >=0.19.2,<1.0,psycopg2 >=2.6.1,<3.0,pyyaml >=3.12,<4.0,scipy >=0.17.0,<1.0',
+        ]
+        for line in test_cases:
+            item = history.History._parse_comment_line(line)
+            specs = item.get('specs')
+            for spec in specs:
+                try:
+                    MatchSpec(spec)
+                except Exception as e:
+                    print('Specs item:', item)
+                    print('Specs:', specs)
+                    print('Invalid Spec:', spec)
+                    raise Exception(e)