Repository: conda/conda

Issue:
conda install with multiple (more than one) packages fails to list packages
Observe:

```
>conda install pyqt
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
pyqt                      5.6.0                    py36_2

>conda install qtpy
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
qtpy                      1.2.1                    py36_0

>conda install pyqt qtpy
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
```

When calling `conda install` with one package, the package version is listed. When calling with multiple packages, the list is missing. As well as being confusing, this makes writing instructions for installation difficult, since the output cannot be verified if combining individual `conda install` commands.
conda install with multiple (more than one) packages fails to list packages
Observe:

```
>conda install pyqt
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
pyqt                      5.6.0                    py36_2

>conda install qtpy
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
qtpy                      1.2.1                    py36_0

>conda install pyqt qtpy
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
```

When calling `conda install` with one package, the package version is listed. When calling with multiple packages, the list is missing. As well as being confusing, this makes writing instructions for installation difficult, since the output cannot be verified if combining individual `conda install` commands.


Discussion:
What version of Conda are you using? 
This does not happen in the recent versions of conda.  `conda update conda` will update your conda to most recent version. 

```
conda install nltk qtpy
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment /Users/tkim/miniconda3:

The following NEW packages will be INSTALLED:

    qtpy: 1.2.1-py27_0

The following packages will be SUPERSEDED by a higher-priority channel:

    nltk: 3.2.2-py27_0 conda-forge --> 3.2.2-py27_0

Proceed ([y]/n)? n
```
`conda                     4.3.17                   py36_0`

I only ran `conda update conda` moments before producing the bug report so I suspect it's up to date.

Your results revealed a clarification though: the issue only occurs for packages **already installed and up to date**. Observe:

```
>conda install nltk
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
nltk                      3.2.2                    py36_0

>conda install nltk qtpy
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#

>conda install nltk affine alabaster
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:

The following NEW packages will be INSTALLED:

    affine:    2.0.0-py36_0

The following packages will be UPDATED:

    alabaster: 0.7.9-py36_0 --> 0.7.10-py36_0

Proceed ([y]/n)? n

Exiting
```

What version of Conda are you using? 
This does not happen in the recent versions of conda.  `conda update conda` will update your conda to most recent version. 

```
conda install nltk qtpy
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment /Users/tkim/miniconda3:

The following NEW packages will be INSTALLED:

    qtpy: 1.2.1-py27_0

The following packages will be SUPERSEDED by a higher-priority channel:

    nltk: 3.2.2-py27_0 conda-forge --> 3.2.2-py27_0

Proceed ([y]/n)? n
```
`conda                     4.3.17                   py36_0`

I only ran `conda update conda` moments before producing the bug report so I suspect it's up to date.

Your results revealed a clarification though: the issue only occurs for packages **already installed and up to date**. Observe:

```
>conda install nltk
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#
nltk                      3.2.2                    py36_0

>conda install nltk qtpy
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:
#

>conda install nltk affine alabaster
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment C:\Users\heath.raftery\AppData\Local\Continuum\Anaconda3:

The following NEW packages will be INSTALLED:

    affine:    2.0.0-py36_0

The following packages will be UPDATED:

    alabaster: 0.7.9-py36_0 --> 0.7.10-py36_0

Proceed ([y]/n)? n

Exiting
```


Resolving patch:
diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -311,20 +311,20 @@ def install(args, parser, command='install'):
             raise CondaImportError(text_type(e))
         raise
 
-    if not context.json:
-        if any(nothing_to_do(actions) for actions in action_set) and not newenv:
+    if any(nothing_to_do(actions) for actions in action_set) and not newenv:
+        if not context.json:
             from .main_list import print_packages
 
-            if not context.json:
-                spec_regex = r'^(%s)$' % re.escape('|'.join(s.split()[0] for s in ospecs))
-                print('\n# All requested packages already installed.')
-                for action in action_set:
-                    print_packages(action["PREFIX"], spec_regex)
-            else:
-                common.stdout_json_success(
-                    message='All requested packages already installed.')
-            return
+            spec_regex = r'^(%s)$' % '|'.join(re.escape(s.split()[0]) for s in ospecs)
+            print('\n# All requested packages already installed.')
+            for action in action_set:
+                print_packages(action["PREFIX"], spec_regex)
+        else:
+            common.stdout_json_success(
+                message='All requested packages already installed.')
+        return
 
+    if not context.json:
         for actions in action_set:
             print()
             print("Package plan for installation in environment %s:" % actions["PREFIX"])


Test patch: