Repository: conda/conda

Issue:
I got: Solving environment: failed
After my Conda environment activated, I issue this command:
`conda update conda`

And I received an error message:

> Solving environment: failed

matches_for_spec:
    - defaults::certifi-2017.11.5-py36hb8ac631_0
    - defaults::h5py-2.7.1-py36he54a1c3_0
    - defaults::hdf5-1.10.1-h98b8871_1
    - defaults::icc_rt-2017.0.4-h97af966_0
    - defaults::intel-openmp-2018.0.0-hd92c6cd_8
    - defaults::keras-2.0.8-py36h65e7a35_0
    - defaults::libprotobuf-3.4.1-h3dba5dd_0
    - defaults::mkl-2018.0.1-h2108138_4
    - defaults::numpy-1.12.1-py36hf30b8aa_1
    - defaults::pip-9.0.1-py36h226ae91_4
    - defaults::protobuf-3.4.1-py36h07fa351_0
    - defaults::python-3.6.3-h3b118a2_4
    - defaults::pyyaml-3.12-py36h1d1928f_1
    - defaults::scipy-1.0.0-py36h1260518_0
    - defaults::setuptools-36.5.0-py36h65f9e6e_0
    - defaults::six-1.11.0-py36h4db2310_1
    - defaults::tensorflow-1.1.0-np112py36_0
    - defaults::vc-14-h2379b0c_2
    - defaults::vs2015_runtime-14.0.25420-0
    - defaults::werkzeug-0.12.2-py36h866a736_0
    - defaults::wheel-0.30.0-py36h6c3ec14_1
    - defaults::wincertstore-0.2-py36h7fe50ca_0
    - defaults::yaml-0.1.7-hc54c509_2
    - defaults::zlib-1.2.11-h8395fce_2

=====
My `conda info` output:

     active environment : tensorflow
    active env location : D:\Anaconda3\envs\tensorflow
            shell level : 2
       user config file : C:\Users\liemld\.condarc
 populated config files :
          conda version : 4.4.3
    conda-build version : 3.0.27
         python version : 3.6.3.final.0
       base environment : D:\Anaconda3  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/win-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/win-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/win-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/win-64
                          https://repo.continuum.io/pkgs/pro/noarch
                          https://repo.continuum.io/pkgs/msys2/win-64
                          https://repo.continuum.io/pkgs/msys2/noarch
          package cache : D:\Anaconda3\pkgs
                          C:\Users\liemld\AppData\Local\conda\conda\pkgs
       envs directories : D:\Anaconda3\envs
                          C:\Users\liemld\AppData\Local\conda\conda\envs
                          C:\Users\liemld\.conda\envs
               platform : win-64
             user-agent : conda/4.4.3 requests/2.18.4 CPython/3.6.3 Windows/10 Windows/10.0.14393
          administrator : False
             netrc file : None
           offline mode : False

====
`conda list`
# packages in environment at D:\Anaconda3\envs\tensorflow:
#
certifi                   2017.11.5        py36hb8ac631_0
h5py                      2.7.1            py36he54a1c3_0
hdf5                      1.10.1               h98b8871_1
icc_rt                    2017.0.4             h97af966_0
intel-openmp              2018.0.0             hd92c6cd_8
keras                     2.0.8            py36h65e7a35_0
libprotobuf               3.4.1                h3dba5dd_0
mkl                       2018.0.1             h2108138_4
numpy                     1.12.1           py36hf30b8aa_1
pip                       9.0.1            py36h226ae91_4
protobuf                  3.4.1            py36h07fa351_0
python                    3.6.3                h3b118a2_4
pyyaml                    3.12             py36h1d1928f_1
scipy                     1.0.0            py36h1260518_0
setuptools                36.5.0           py36h65f9e6e_0
six                       1.11.0           py36h4db2310_1
tensorflow                1.1.0               np112py36_0
vc                        14                   h2379b0c_2
vs2015_runtime            14.0.25420                    0
werkzeug                  0.12.2           py36h866a736_0
wheel                     0.30.0           py36h6c3ec14_1
wincertstore              0.2              py36h7fe50ca_0
yaml                      0.1.7                hc54c509_2
zlib                      1.2.11               h8395fce_2

Pls help!

With many thanks,


Discussion:
Thanks for filing this issue.  I added that special error message to help us get to the bottom of something confusing we were seeing in automatically-uploaded error reports.

I think I'm getting close to understanding this, but could use one more piece of information...

Do you mind posting here an additional file (probably just drag and drop into the text box area).  The file I need to see is the history file located at

    D:\Anaconda3\envs\tensorflow\conda-meta\history


[history.zip](https://github.com/conda/conda/files/1583963/history.zip)
Thanks for quick response.
I attached herewith the zipped "history" file.

Resolving patch:
diff --git a/conda/history.py b/conda/history.py
--- a/conda/history.py
+++ b/conda/history.py
@@ -163,7 +163,7 @@ def get_user_requests(self):
                         specs = literal_eval(specs)
                     elif '[' not in specs:
                         specs = specs.split(',')
-                    specs = [spec for spec in specs if not spec.endswith('@')]
+                    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'):


Test patch: