We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
conda env update fails with pip dependencies if Python version changes
**I'm submitting a...**
  - [x] bug report
  - [ ] feature request

**update:** only the root env appears to be affected

## Current Behavior

`conda env update -f environment.yml` fails if both of these conditions are met:

1. The Python version changes
2. There is at least one dependency to be installed with pip

The error looks like:

```
Unable to install package for pip.

Please double check and ensure you dependencies file has
the correct spelling.  You might also try installing the
conda-env-pip package to see if provides the required
installer.
```

This is the same error but not the same bug as #4985. pip is installed and specified as a dependency, but switching Python version in the same transaction results in conda failing to find pip.

### Steps to Reproduce

Create an environment.yml that contains Python and at least one pip dependency (doesn't matter if it's already installed or not):

```yaml
# environment.yml
dependencies:
  - python=3.5
  - pip
  - pip:
    - wheel
```

Setup a root env with a *different* Python:

```
conda install python=3.6 pip
```

and then try to update it with the environment file

```
conda env update -n root -f environment.yml
```


## Expected Behavior

`conda env update` should succeed.
<!-- What do you think should happen? -->


## Environment Information

Run in docker with [these files](https://gist.github.com/7d234cbcf69df2c7cd68523c9327db71).

<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
     active environment : None
       user config file : /root/.condarc
 populated config files :
          conda version : 4.4.8
    conda-build version : not installed
         python version : 3.6.2.final.0
       base environment : /opt/conda  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.4.8 requests/2.18.4 CPython/3.6.2 Linux/4.9.75-linuxkit-aufs debian/8 glibc/2.19
                UID:GID : 0:0
             netrc file : None
           offline mode : False
```
</p></details>


conda env update fails with pip dependencies if Python version changes
**I'm submitting a...**
  - [x] bug report
  - [ ] feature request

**update:** only the root env appears to be affected

## Current Behavior

`conda env update -f environment.yml` fails if both of these conditions are met:

1. The Python version changes
2. There is at least one dependency to be installed with pip

The error looks like:

```
Unable to install package for pip.

Please double check and ensure you dependencies file has
the correct spelling.  You might also try installing the
conda-env-pip package to see if provides the required
installer.
```

This is the same error but not the same bug as #4985. pip is installed and specified as a dependency, but switching Python version in the same transaction results in conda failing to find pip.

### Steps to Reproduce

Create an environment.yml that contains Python and at least one pip dependency (doesn't matter if it's already installed or not):

```yaml
# environment.yml
dependencies:
  - python=3.5
  - pip
  - pip:
    - wheel
```

Setup a root env with a *different* Python:

```
conda install python=3.6 pip
```

and then try to update it with the environment file

```
conda env update -n root -f environment.yml
```


## Expected Behavior

`conda env update` should succeed.
<!-- What do you think should happen? -->


## Environment Information

Run in docker with [these files](https://gist.github.com/7d234cbcf69df2c7cd68523c9327db71).

<details open><summary><code>`conda info`</code></summary><p>
<!-- between the ticks below, paste the output of 'conda info' -->

```
     active environment : None
       user config file : /root/.condarc
 populated config files :
          conda version : 4.4.8
    conda-build version : not installed
         python version : 3.6.2.final.0
       base environment : /opt/conda  (writable)
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
          package cache : /opt/conda/pkgs
                          /root/.conda/pkgs
       envs directories : /opt/conda/envs
                          /root/.conda/envs
               platform : linux-64
             user-agent : conda/4.4.8 requests/2.18.4 CPython/3.6.2 Linux/4.9.75-linuxkit-aufs debian/8 glibc/2.19
                UID:GID : 0:0
             netrc file : None
           offline mode : False
```
</p></details>



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `conda_env/cli/main_update.py`
Content:
```
1 from argparse import RawDescriptionHelpFormatter
2 import os
3 import sys
4 import textwrap
5 
6 from conda._vendor.auxlib.path import expand
7 from conda.cli import install as cli_install
8 from conda.cli.conda_argparse import add_parser_json, add_parser_prefix
9 from conda.misc import touch_nonadmin
10 from .common import get_prefix
11 from .. import exceptions, specs as install_specs
12 from ..exceptions import CondaEnvException
13 from ..installers.base import InvalidInstaller, get_installer
14 
15 description = """
16 Update the current environment based on environment file
17 """
18 
19 example = """
20 examples:
21     conda env update
22     conda env update -n=foo
23     conda env update -f=/path/to/environment.yml
24     conda env update --name=foo --file=environment.yml
25     conda env update vader/deathstar
26 """
27 
28 
29 def configure_parser(sub_parsers):
30     p = sub_parsers.add_parser(
31         'update',
32         formatter_class=RawDescriptionHelpFormatter,
33         description=description,
34         help=description,
35         epilog=example,
36     )
37     add_parser_prefix(p)
38     p.add_argument(
39         '-f', '--file',
40         action='store',
41         help='environment definition (default: environment.yml)',
42         default='environment.yml',
43     )
44     p.add_argument(
45         '--prune',
46         action='store_true',
47         default=False,
48         help='remove installed packages not defined in environment.yml',
49     )
50     p.add_argument(
51         '-q', '--quiet',
52         action='store_true',
53         default=False,
54     )
55     p.add_argument(
56         'remote_definition',
57         help='remote environment definition / IPython notebook',
58         action='store',
59         default=None,
60         nargs='?'
61     )
62     add_parser_json(p)
63     p.set_defaults(func='.main_update.execute')
64 
65 
66 def execute(args, parser):
67     name = args.remote_definition or args.name
68 
69     try:
70         spec = install_specs.detect(name=name, filename=expand(args.file),
71                                     directory=os.getcwd())
72         env = spec.environment
73     except exceptions.SpecNotFound:
74         raise
75 
76     if not (args.name or args.prefix):
77         if not env.name:
78                     # Note, this is a hack fofr get_prefix that assumes argparse results
79             # TODO Refactor common.get_prefix
80             name = os.environ.get('CONDA_DEFAULT_ENV', False)
81             if not name:
82                 msg = "Unable to determine environment\n\n"
83                 msg += textwrap.dedent("""
84                     Please re-run this command with one of the following options:
85 
86                     * Provide an environment name via --name or -n
87                     * Re-run this command inside an activated conda environment.""").lstrip()
88                 # TODO Add json support
89                 raise CondaEnvException(msg)
90 
91         # Note: stubbing out the args object as all of the
92         # conda.cli.common code thinks that name will always
93         # be specified.
94         args.name = env.name
95 
96     prefix = get_prefix(args, search=False)
97     # CAN'T Check with this function since it assumes we will create prefix.
98     # cli_install.check_prefix(prefix, json=args.json)
99 
100     # TODO, add capability
101     # common.ensure_override_channels_requires_channel(args)
102     # channel_urls = args.channel or ()
103 
104     for installer_type, specs in env.dependencies.items():
105         try:
106             installer = get_installer(installer_type)
107             installer.install(prefix, specs, args, env)
108         except InvalidInstaller:
109             sys.stderr.write(textwrap.dedent("""
110                 Unable to install package for {0}.
111 
112                 Please double check and ensure you dependencies file has
113                 the correct spelling.  You might also try installing the
114                 conda-env-{0} package to see if provides the required
115                 installer.
116                 """).lstrip().format(installer_type)
117             )
118             return -1
119 
120     touch_nonadmin(prefix)
121     cli_install.print_activate(args.name if args.name else prefix)
122
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/conda_env/cli/main_update.py b/conda_env/cli/main_update.py
--- a/conda_env/cli/main_update.py
+++ b/conda_env/cli/main_update.py
@@ -101,11 +101,15 @@
     # common.ensure_override_channels_requires_channel(args)
     # channel_urls = args.channel or ()
 
-    for installer_type, specs in env.dependencies.items():
+    # create installers before running any of them
+    # to avoid failure to import after the file being deleted
+    # e.g. due to conda_env being upgraded or Python version switched.
+    installers = {}
+
+    for installer_type in env.dependencies:
         try:
-            installer = get_installer(installer_type)
-            installer.install(prefix, specs, args, env)
-        except InvalidInstaller:
+            installers[installer_type] = get_installer(installer_type)
+        except InvalidInstaller as e:
             sys.stderr.write(textwrap.dedent("""
                 Unable to install package for {0}.
 
@@ -117,5 +121,9 @@
             )
             return -1
 
+    for installer_type, specs in env.dependencies.items():
+        installer = installers[installer_type]
+        installer.install(prefix, specs, args, env)
+
     touch_nonadmin(prefix)
     cli_install.print_activate(args.name if args.name else prefix)

{"golden_diff": "diff --git a/conda_env/cli/main_update.py b/conda_env/cli/main_update.py\n--- a/conda_env/cli/main_update.py\n+++ b/conda_env/cli/main_update.py\n@@ -101,11 +101,15 @@\n     # common.ensure_override_channels_requires_channel(args)\n     # channel_urls = args.channel or ()\n \n-    for installer_type, specs in env.dependencies.items():\n+    # create installers before running any of them\n+    # to avoid failure to import after the file being deleted\n+    # e.g. due to conda_env being upgraded or Python version switched.\n+    installers = {}\n+\n+    for installer_type in env.dependencies:\n         try:\n-            installer = get_installer(installer_type)\n-            installer.install(prefix, specs, args, env)\n-        except InvalidInstaller:\n+            installers[installer_type] = get_installer(installer_type)\n+        except InvalidInstaller as e:\n             sys.stderr.write(textwrap.dedent(\"\"\"\n                 Unable to install package for {0}.\n \n@@ -117,5 +121,9 @@\n             )\n             return -1\n \n+    for installer_type, specs in env.dependencies.items():\n+        installer = installers[installer_type]\n+        installer.install(prefix, specs, args, env)\n+\n     touch_nonadmin(prefix)\n     cli_install.print_activate(args.name if args.name else prefix)\n", "issue": "conda env update fails with pip dependencies if Python version changes\n**I'm submitting a...**\r\n  - [x] bug report\r\n  - [ ] feature request\r\n\r\n**update:** only the root env appears to be affected\r\n\r\n## Current Behavior\r\n\r\n`conda env update -f environment.yml` fails if both of these conditions are met:\r\n\r\n1. The Python version changes\r\n2. There is at least one dependency to be installed with pip\r\n\r\nThe error looks like:\r\n\r\n```\r\nUnable to install package for pip.\r\n\r\nPlease double check and ensure you dependencies file has\r\nthe correct spelling.  You might also try installing the\r\nconda-env-pip package to see if provides the required\r\ninstaller.\r\n```\r\n\r\nThis is the same error but not the same bug as #4985. pip is installed and specified as a dependency, but switching Python version in the same transaction results in conda failing to find pip.\r\n\r\n### Steps to Reproduce\r\n\r\nCreate an environment.yml that contains Python and at least one pip dependency (doesn't matter if it's already installed or not):\r\n\r\n```yaml\r\n# environment.yml\r\ndependencies:\r\n  - python=3.5\r\n  - pip\r\n  - pip:\r\n    - wheel\r\n```\r\n\r\nSetup a root env with a *different* Python:\r\n\r\n```\r\nconda install python=3.6 pip\r\n```\r\n\r\nand then try to update it with the environment file\r\n\r\n```\r\nconda env update -n root -f environment.yml\r\n```\r\n\r\n\r\n## Expected Behavior\r\n\r\n`conda env update` should succeed.\r\n<!-- What do you think should happen? -->\r\n\r\n\r\n## Environment Information\r\n\r\nRun in docker with [these files](https://gist.github.com/7d234cbcf69df2c7cd68523c9327db71).\r\n\r\n<details open><summary><code>`conda info`</code></summary><p>\r\n<!-- between the ticks below, paste the output of 'conda info' -->\r\n\r\n```\r\n     active environment : None\r\n       user config file : /root/.condarc\r\n populated config files :\r\n          conda version : 4.4.8\r\n    conda-build version : not installed\r\n         python version : 3.6.2.final.0\r\n       base environment : /opt/conda  (writable)\r\n           channel URLs : https://repo.continuum.io/pkgs/main/linux-64\r\n                          https://repo.continuum.io/pkgs/main/noarch\r\n                          https://repo.continuum.io/pkgs/free/linux-64\r\n                          https://repo.continuum.io/pkgs/free/noarch\r\n                          https://repo.continuum.io/pkgs/r/linux-64\r\n                          https://repo.continuum.io/pkgs/r/noarch\r\n                          https://repo.continuum.io/pkgs/pro/linux-64\r\n                          https://repo.continuum.io/pkgs/pro/noarch\r\n          package cache : /opt/conda/pkgs\r\n                          /root/.conda/pkgs\r\n       envs directories : /opt/conda/envs\r\n                          /root/.conda/envs\r\n               platform : linux-64\r\n             user-agent : conda/4.4.8 requests/2.18.4 CPython/3.6.2 Linux/4.9.75-linuxkit-aufs debian/8 glibc/2.19\r\n                UID:GID : 0:0\r\n             netrc file : None\r\n           offline mode : False\r\n```\r\n</p></details>\r\n\r\n\nconda env update fails with pip dependencies if Python version changes\n**I'm submitting a...**\r\n  - [x] bug report\r\n  - [ ] feature request\r\n\r\n**update:** only the root env appears to be affected\r\n\r\n## Current Behavior\r\n\r\n`conda env update -f environment.yml` fails if both of these conditions are met:\r\n\r\n1. The Python version changes\r\n2. There is at least one dependency to be installed with pip\r\n\r\nThe error looks like:\r\n\r\n```\r\nUnable to install package for pip.\r\n\r\nPlease double check and ensure you dependencies file has\r\nthe correct spelling.  You might also try installing the\r\nconda-env-pip package to see if provides the required\r\ninstaller.\r\n```\r\n\r\nThis is the same error but not the same bug as #4985. pip is installed and specified as a dependency, but switching Python version in the same transaction results in conda failing to find pip.\r\n\r\n### Steps to Reproduce\r\n\r\nCreate an environment.yml that contains Python and at least one pip dependency (doesn't matter if it's already installed or not):\r\n\r\n```yaml\r\n# environment.yml\r\ndependencies:\r\n  - python=3.5\r\n  - pip\r\n  - pip:\r\n    - wheel\r\n```\r\n\r\nSetup a root env with a *different* Python:\r\n\r\n```\r\nconda install python=3.6 pip\r\n```\r\n\r\nand then try to update it with the environment file\r\n\r\n```\r\nconda env update -n root -f environment.yml\r\n```\r\n\r\n\r\n## Expected Behavior\r\n\r\n`conda env update` should succeed.\r\n<!-- What do you think should happen? -->\r\n\r\n\r\n## Environment Information\r\n\r\nRun in docker with [these files](https://gist.github.com/7d234cbcf69df2c7cd68523c9327db71).\r\n\r\n<details open><summary><code>`conda info`</code></summary><p>\r\n<!-- between the ticks below, paste the output of 'conda info' -->\r\n\r\n```\r\n     active environment : None\r\n       user config file : /root/.condarc\r\n populated config files :\r\n          conda version : 4.4.8\r\n    conda-build version : not installed\r\n         python version : 3.6.2.final.0\r\n       base environment : /opt/conda  (writable)\r\n           channel URLs : https://repo.continuum.io/pkgs/main/linux-64\r\n                          https://repo.continuum.io/pkgs/main/noarch\r\n                          https://repo.continuum.io/pkgs/free/linux-64\r\n                          https://repo.continuum.io/pkgs/free/noarch\r\n                          https://repo.continuum.io/pkgs/r/linux-64\r\n                          https://repo.continuum.io/pkgs/r/noarch\r\n                          https://repo.continuum.io/pkgs/pro/linux-64\r\n                          https://repo.continuum.io/pkgs/pro/noarch\r\n          package cache : /opt/conda/pkgs\r\n                          /root/.conda/pkgs\r\n       envs directories : /opt/conda/envs\r\n                          /root/.conda/envs\r\n               platform : linux-64\r\n             user-agent : conda/4.4.8 requests/2.18.4 CPython/3.6.2 Linux/4.9.75-linuxkit-aufs debian/8 glibc/2.19\r\n                UID:GID : 0:0\r\n             netrc file : None\r\n           offline mode : False\r\n```\r\n</p></details>\r\n\r\n\n", "before_files": [{"content": "from argparse import RawDescriptionHelpFormatter\nimport os\nimport sys\nimport textwrap\n\nfrom conda._vendor.auxlib.path import expand\nfrom conda.cli import install as cli_install\nfrom conda.cli.conda_argparse import add_parser_json, add_parser_prefix\nfrom conda.misc import touch_nonadmin\nfrom .common import get_prefix\nfrom .. import exceptions, specs as install_specs\nfrom ..exceptions import CondaEnvException\nfrom ..installers.base import InvalidInstaller, get_installer\n\ndescription = \"\"\"\nUpdate the current environment based on environment file\n\"\"\"\n\nexample = \"\"\"\nexamples:\n    conda env update\n    conda env update -n=foo\n    conda env update -f=/path/to/environment.yml\n    conda env update --name=foo --file=environment.yml\n    conda env update vader/deathstar\n\"\"\"\n\n\ndef configure_parser(sub_parsers):\n    p = sub_parsers.add_parser(\n        'update',\n        formatter_class=RawDescriptionHelpFormatter,\n        description=description,\n        help=description,\n        epilog=example,\n    )\n    add_parser_prefix(p)\n    p.add_argument(\n        '-f', '--file',\n        action='store',\n        help='environment definition (default: environment.yml)',\n        default='environment.yml',\n    )\n    p.add_argument(\n        '--prune',\n        action='store_true',\n        default=False,\n        help='remove installed packages not defined in environment.yml',\n    )\n    p.add_argument(\n        '-q', '--quiet',\n        action='store_true',\n        default=False,\n    )\n    p.add_argument(\n        'remote_definition',\n        help='remote environment definition / IPython notebook',\n        action='store',\n        default=None,\n        nargs='?'\n    )\n    add_parser_json(p)\n    p.set_defaults(func='.main_update.execute')\n\n\ndef execute(args, parser):\n    name = args.remote_definition or args.name\n\n    try:\n        spec = install_specs.detect(name=name, filename=expand(args.file),\n                                    directory=os.getcwd())\n        env = spec.environment\n    except exceptions.SpecNotFound:\n        raise\n\n    if not (args.name or args.prefix):\n        if not env.name:\n                    # Note, this is a hack fofr get_prefix that assumes argparse results\n            # TODO Refactor common.get_prefix\n            name = os.environ.get('CONDA_DEFAULT_ENV', False)\n            if not name:\n                msg = \"Unable to determine environment\\n\\n\"\n                msg += textwrap.dedent(\"\"\"\n                    Please re-run this command with one of the following options:\n\n                    * Provide an environment name via --name or -n\n                    * Re-run this command inside an activated conda environment.\"\"\").lstrip()\n                # TODO Add json support\n                raise CondaEnvException(msg)\n\n        # Note: stubbing out the args object as all of the\n        # conda.cli.common code thinks that name will always\n        # be specified.\n        args.name = env.name\n\n    prefix = get_prefix(args, search=False)\n    # CAN'T Check with this function since it assumes we will create prefix.\n    # cli_install.check_prefix(prefix, json=args.json)\n\n    # TODO, add capability\n    # common.ensure_override_channels_requires_channel(args)\n    # channel_urls = args.channel or ()\n\n    for installer_type, specs in env.dependencies.items():\n        try:\n            installer = get_installer(installer_type)\n            installer.install(prefix, specs, args, env)\n        except InvalidInstaller:\n            sys.stderr.write(textwrap.dedent(\"\"\"\n                Unable to install package for {0}.\n\n                Please double check and ensure you dependencies file has\n                the correct spelling.  You might also try installing the\n                conda-env-{0} package to see if provides the required\n                installer.\n                \"\"\").lstrip().format(installer_type)\n            )\n            return -1\n\n    touch_nonadmin(prefix)\n    cli_install.print_activate(args.name if args.name else prefix)\n", "path": "conda_env/cli/main_update.py"}], "after_files": [{"content": "from argparse import RawDescriptionHelpFormatter\nimport os\nimport sys\nimport textwrap\n\nfrom conda._vendor.auxlib.path import expand\nfrom conda.cli import install as cli_install\nfrom conda.cli.conda_argparse import add_parser_json, add_parser_prefix\nfrom conda.misc import touch_nonadmin\nfrom .common import get_prefix\nfrom .. import exceptions, specs as install_specs\nfrom ..exceptions import CondaEnvException\nfrom ..installers.base import InvalidInstaller, get_installer\n\ndescription = \"\"\"\nUpdate the current environment based on environment file\n\"\"\"\n\nexample = \"\"\"\nexamples:\n    conda env update\n    conda env update -n=foo\n    conda env update -f=/path/to/environment.yml\n    conda env update --name=foo --file=environment.yml\n    conda env update vader/deathstar\n\"\"\"\n\n\ndef configure_parser(sub_parsers):\n    p = sub_parsers.add_parser(\n        'update',\n        formatter_class=RawDescriptionHelpFormatter,\n        description=description,\n        help=description,\n        epilog=example,\n    )\n    add_parser_prefix(p)\n    p.add_argument(\n        '-f', '--file',\n        action='store',\n        help='environment definition (default: environment.yml)',\n        default='environment.yml',\n    )\n    p.add_argument(\n        '--prune',\n        action='store_true',\n        default=False,\n        help='remove installed packages not defined in environment.yml',\n    )\n    p.add_argument(\n        '-q', '--quiet',\n        action='store_true',\n        default=False,\n    )\n    p.add_argument(\n        'remote_definition',\n        help='remote environment definition / IPython notebook',\n        action='store',\n        default=None,\n        nargs='?'\n    )\n    add_parser_json(p)\n    p.set_defaults(func='.main_update.execute')\n\n\ndef execute(args, parser):\n    name = args.remote_definition or args.name\n\n    try:\n        spec = install_specs.detect(name=name, filename=expand(args.file),\n                                    directory=os.getcwd())\n        env = spec.environment\n    except exceptions.SpecNotFound:\n        raise\n\n    if not (args.name or args.prefix):\n        if not env.name:\n                    # Note, this is a hack fofr get_prefix that assumes argparse results\n            # TODO Refactor common.get_prefix\n            name = os.environ.get('CONDA_DEFAULT_ENV', False)\n            if not name:\n                msg = \"Unable to determine environment\\n\\n\"\n                msg += textwrap.dedent(\"\"\"\n                    Please re-run this command with one of the following options:\n\n                    * Provide an environment name via --name or -n\n                    * Re-run this command inside an activated conda environment.\"\"\").lstrip()\n                # TODO Add json support\n                raise CondaEnvException(msg)\n\n        # Note: stubbing out the args object as all of the\n        # conda.cli.common code thinks that name will always\n        # be specified.\n        args.name = env.name\n\n    prefix = get_prefix(args, search=False)\n    # CAN'T Check with this function since it assumes we will create prefix.\n    # cli_install.check_prefix(prefix, json=args.json)\n\n    # TODO, add capability\n    # common.ensure_override_channels_requires_channel(args)\n    # channel_urls = args.channel or ()\n\n    # create installers before running any of them\n    # to avoid failure to import after the file being deleted\n    # e.g. due to conda_env being upgraded or Python version switched.\n    installers = {}\n\n    for installer_type in env.dependencies:\n        try:\n            installers[installer_type] = get_installer(installer_type)\n        except InvalidInstaller as e:\n            sys.stderr.write(textwrap.dedent(\"\"\"\n                Unable to install package for {0}.\n\n                Please double check and ensure you dependencies file has\n                the correct spelling.  You might also try installing the\n                conda-env-{0} package to see if provides the required\n                installer.\n                \"\"\").lstrip().format(installer_type)\n            )\n            return -1\n\n    for installer_type, specs in env.dependencies.items():\n        installer = installers[installer_type]\n        installer.install(prefix, specs, args, env)\n\n    touch_nonadmin(prefix)\n    cli_install.print_activate(args.name if args.name else prefix)\n", "path": "conda_env/cli/main_update.py"}]}