prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [SETUP-BUG] ResolvePackageNotFound - python=3.5.2
  Thank you for submitting an issue. Please refer to our [issue policy](https://www.github.com/mlflow/mlflow/blob/master/ISSUE_POLICY.md)
  for information on what types of issues we address.
    
  Please fill in this template and do not delete it unless you are sure your issue is outside its scope.
  
  ### System information
  - **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Ubuntu 16.04
  - **MLflow installed from (source or binary)**:  binary (pip install mlflow)
  - **MLflow version (run ``mlflow --version``)**: 1.2.0
  - **Python version**: 3.5.2
  - **Exact command to reproduce**: mlflow models build-docker -m /path/to/model -n "my-model" 
  
  ### Describe the problem
  mlflow models build-docker -m /path/to/model -n "my-model"
  
  ### Other info / logs
  Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your condadependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Pleaseadd an explicit pip dependency.  I'm adding one for you, but still nagging you.
  Collecting package metadata (repodata.json): ...working... done
  Solving environment: ...working... failed
  
  ResolvePackageNotFound:
    - python=3.5.2
  
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/miniconda/lib/python3.7/site-packages/mlflow/models/container/__init__.py", line 102, in _install_pyfunc_deps
      raise Exception("Failed to create model environment.")
  Exception: Failed to create model environment.
  creating and activating custom environment
  The command '/bin/sh -c python -c                 'from mlflow.models.container import _install_pyfunc_deps; _install_pyfunc_deps("/opt/ml/model", install_mlflow=False)'' returned a non-zero code: 1
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mlflow/utils/environment.py`
  Content:
  ```
  1 import yaml
  2 
  3 from mlflow.utils import PYTHON_VERSION
  4 
  5 _conda_header = """\
  6 name: mlflow-env
  7 channels:
  8   - defaults
  9 """
  10 
  11 
  12 def _mlflow_conda_env(path=None, additional_conda_deps=None, additional_pip_deps=None,
  13                       additional_conda_channels=None, install_mlflow=True):
  14     """
  15     Creates a Conda environment with the specified package channels and dependencies. If there are
  16     any pip dependencies, including from the install_mlflow parameter, then pip will be added to
  17     the conda dependencies. This is done to ensure that the pip inside the conda environment is
  18     used to install the pip dependencies.
  19 
  20     :param path: Local filesystem path where the conda env file is to be written. If unspecified,
  21                  the conda env will not be written to the filesystem; it will still be returned
  22                  in dictionary format.
  23     :param additional_conda_deps: List of additional conda dependencies passed as strings.
  24     :param additional_pip_deps: List of additional pip dependencies passed as strings.
  25     :param additional_conda_channels: List of additional conda channels to search when resolving
  26                                       packages.
  27     :return: ``None`` if ``path`` is specified. Otherwise, the a dictionary representation of the
  28              Conda environment.
  29     """
  30     pip_deps = (["mlflow"] if install_mlflow else []) + (
  31         additional_pip_deps if additional_pip_deps else [])
  32     conda_deps = (additional_conda_deps if additional_conda_deps else []) + (
  33         ["pip"] if pip_deps else [])
  34 
  35     env = yaml.safe_load(_conda_header)
  36     env["dependencies"] = ["python={}".format(PYTHON_VERSION)]
  37     if conda_deps is not None:
  38         env["dependencies"] += conda_deps
  39     env["dependencies"].append({"pip": pip_deps})
  40     if additional_conda_channels is not None:
  41         env["channels"] += additional_conda_channels
  42 
  43     if path is not None:
  44         with open(path, "w") as out:
  45             yaml.safe_dump(env, stream=out, default_flow_style=False)
  46         return None
  47     else:
  48         return env
  49
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/mlflow/utils/environment.py b/mlflow/utils/environment.py
  --- a/mlflow/utils/environment.py
  +++ b/mlflow/utils/environment.py
  @@ -6,6 +6,7 @@
   name: mlflow-env
   channels:
     - defaults
  +  - conda-forge
   """
  
verification_info: {"golden_diff": "diff --git a/mlflow/utils/environment.py b/mlflow/utils/environment.py\n--- a/mlflow/utils/environment.py\n+++ b/mlflow/utils/environment.py\n@@ -6,6 +6,7 @@\n name: mlflow-env\n channels:\n   - defaults\n+  - conda-forge\n \"\"\"\n", "issue": "[SETUP-BUG] ResolvePackageNotFound - python=3.5.2\nThank you for submitting an issue. Please refer to our [issue policy](https://www.github.com/mlflow/mlflow/blob/master/ISSUE_POLICY.md)\r\nfor information on what types of issues we address.\r\n  \r\nPlease fill in this template and do not delete it unless you are sure your issue is outside its scope.\r\n\r\n### System information\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Ubuntu 16.04\r\n- **MLflow installed from (source or binary)**:  binary (pip install mlflow)\r\n- **MLflow version (run ``mlflow --version``)**: 1.2.0\r\n- **Python version**: 3.5.2\r\n- **Exact command to reproduce**: mlflow models build-docker -m /path/to/model -n \"my-model\" \r\n\r\n### Describe the problem\r\nmlflow models build-docker -m /path/to/model -n \"my-model\"\r\n\r\n### Other info / logs\r\nWarning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your condadependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Pleaseadd an explicit pip dependency.  I'm adding one for you, but still nagging you.\r\nCollecting package metadata (repodata.json): ...working... done\r\nSolving environment: ...working... failed\r\n\r\nResolvePackageNotFound:\r\n  - python=3.5.2\r\n\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\n  File \"/miniconda/lib/python3.7/site-packages/mlflow/models/container/__init__.py\", line 102, in _install_pyfunc_deps\r\n    raise Exception(\"Failed to create model environment.\")\r\nException: Failed to create model environment.\r\ncreating and activating custom environment\r\nThe command '/bin/sh -c python -c                 'from mlflow.models.container import _install_pyfunc_deps; _install_pyfunc_deps(\"/opt/ml/model\", install_mlflow=False)'' returned a non-zero code: 1\r\n\n", "before_files": [{"content": "import yaml\n\nfrom mlflow.utils import PYTHON_VERSION\n\n_conda_header = \"\"\"\\\nname: mlflow-env\nchannels:\n  - defaults\n\"\"\"\n\n\ndef _mlflow_conda_env(path=None, additional_conda_deps=None, additional_pip_deps=None,\n                      additional_conda_channels=None, install_mlflow=True):\n    \"\"\"\n    Creates a Conda environment with the specified package channels and dependencies. If there are\n    any pip dependencies, including from the install_mlflow parameter, then pip will be added to\n    the conda dependencies. This is done to ensure that the pip inside the conda environment is\n    used to install the pip dependencies.\n\n    :param path: Local filesystem path where the conda env file is to be written. If unspecified,\n                 the conda env will not be written to the filesystem; it will still be returned\n                 in dictionary format.\n    :param additional_conda_deps: List of additional conda dependencies passed as strings.\n    :param additional_pip_deps: List of additional pip dependencies passed as strings.\n    :param additional_conda_channels: List of additional conda channels to search when resolving\n                                      packages.\n    :return: ``None`` if ``path`` is specified. Otherwise, the a dictionary representation of the\n             Conda environment.\n    \"\"\"\n    pip_deps = ([\"mlflow\"] if install_mlflow else []) + (\n        additional_pip_deps if additional_pip_deps else [])\n    conda_deps = (additional_conda_deps if additional_conda_deps else []) + (\n        [\"pip\"] if pip_deps else [])\n\n    env = yaml.safe_load(_conda_header)\n    env[\"dependencies\"] = [\"python={}\".format(PYTHON_VERSION)]\n    if conda_deps is not None:\n        env[\"dependencies\"] += conda_deps\n    env[\"dependencies\"].append({\"pip\": pip_deps})\n    if additional_conda_channels is not None:\n        env[\"channels\"] += additional_conda_channels\n\n    if path is not None:\n        with open(path, \"w\") as out:\n            yaml.safe_dump(env, stream=out, default_flow_style=False)\n        return None\n    else:\n        return env\n", "path": "mlflow/utils/environment.py"}], "after_files": [{"content": "import yaml\n\nfrom mlflow.utils import PYTHON_VERSION\n\n_conda_header = \"\"\"\\\nname: mlflow-env\nchannels:\n  - defaults\n  - conda-forge\n\"\"\"\n\n\ndef _mlflow_conda_env(path=None, additional_conda_deps=None, additional_pip_deps=None,\n                      additional_conda_channels=None, install_mlflow=True):\n    \"\"\"\n    Creates a Conda environment with the specified package channels and dependencies. If there are\n    any pip dependencies, including from the install_mlflow parameter, then pip will be added to\n    the conda dependencies. This is done to ensure that the pip inside the conda environment is\n    used to install the pip dependencies.\n\n    :param path: Local filesystem path where the conda env file is to be written. If unspecified,\n                 the conda env will not be written to the filesystem; it will still be returned\n                 in dictionary format.\n    :param additional_conda_deps: List of additional conda dependencies passed as strings.\n    :param additional_pip_deps: List of additional pip dependencies passed as strings.\n    :param additional_conda_channels: List of additional conda channels to search when resolving\n                                      packages.\n    :return: ``None`` if ``path`` is specified. Otherwise, the a dictionary representation of the\n             Conda environment.\n    \"\"\"\n    pip_deps = ([\"mlflow\"] if install_mlflow else []) + (\n        additional_pip_deps if additional_pip_deps else [])\n    conda_deps = (additional_conda_deps if additional_conda_deps else []) + (\n        [\"pip\"] if pip_deps else [])\n\n    env = yaml.safe_load(_conda_header)\n    env[\"dependencies\"] = [\"python={}\".format(PYTHON_VERSION)]\n    if conda_deps is not None:\n        env[\"dependencies\"] += conda_deps\n    env[\"dependencies\"].append({\"pip\": pip_deps})\n    if additional_conda_channels is not None:\n        env[\"channels\"] += additional_conda_channels\n\n    if path is not None:\n        with open(path, \"w\") as out:\n            yaml.safe_dump(env, stream=out, default_flow_style=False)\n        return None\n    else:\n        return env\n", "path": "mlflow/utils/environment.py"}]}