Repository: conda/conda

Issue:
conda 4.4 incorrect activate message
I updated to conda 4.4.0b2 from conda v4.3. I created a new environment and it recommended the following - which I ran and got an error:

To activate this environment, use

    $ conda activate anaconda2

To deactivate an active environment, use

    $ conda deactivate

0288-csoja:scripts csoja$ conda activate anaconda2
Traceback (most recent call last):
  File "/Users/csoja/Desktop/anaconda/lib/python3.5/site-packages/conda/cli/main.py", line 176, in main
    raise CommandNotFoundError(argv1)
conda.exceptions.CommandNotFoundError: 'activate is not a conda command.
Did you mean 'source activate'?


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/csoja/Desktop/anaconda/bin/conda", line 6, in <module>
    sys.exit(conda.cli.main())
  File "/Users/csoja/Desktop/anaconda/lib/python3.5/site-packages/conda/cli/main.py", line 178, in main
    from ..exceptions import handle_exception
ImportError: cannot import name 'handle_exception'


Discussion:
Duplicate of #5738


Resolving patch:
diff --git a/conda/cli/install.py b/conda/cli/install.py
--- a/conda/cli/install.py
+++ b/conda/cli/install.py
@@ -16,7 +16,7 @@
 from .._vendor.auxlib.ish import dals
 from ..base.constants import ROOT_ENV_NAME
 from ..base.context import context
-from ..common.compat import text_type
+from ..common.compat import text_type, on_win
 from ..core.envs_manager import EnvsDirectory
 from ..core.index import calculate_channel_urls, get_index
 from ..core.solve import Solver
@@ -80,16 +80,39 @@ def clone(src_arg, dst_prefix, json=False, quiet=False, index_args=None):
 
 def print_activate(env_name_or_prefix):  # pragma: no cover
     if not context.quiet and not context.json:
-        message = dals("""
-
-        To activate this environment, use
-
-            $ conda activate %s
-
-        To deactivate an active environment, use
-
-            $ conda deactivate
-        """) % env_name_or_prefix
+        if 'CONDA_SHLVL' in os.environ or os.path.split(os.environ.get('SHELL', ''))[-1] == 'fish':
+            message = dals("""
+            #
+            # To activate this environment, use
+            #
+            #     $ conda activate %s
+            #
+            # To deactivate an active environment, use
+            #
+            #     $ conda deactivate
+            """) % env_name_or_prefix
+        elif on_win:
+            message = dals("""
+            #
+            # To activate this environment, use:
+            # > activate %s
+            #
+            # To deactivate an active environment, use:
+            # > deactivate
+            #
+            # * for power-users using bash, you must source
+            #
+            """) % env_name_or_prefix
+        else:
+            message = dals("""
+            #
+            # To activate this environment, use:
+            # > source activate %s
+            #
+            # To deactivate an active environment, use:
+            # > source deactivate
+            #
+            """) % env_name_or_prefix
         print(message)  # TODO: use logger
 
 


Test patch: