Skip to content

Commit 86eb20c

Browse files
authored
Merge pull request #111693 from nibaccam/patch-3
change conda installs
2 parents 3f39017 + 2c60977 commit 86eb20c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

articles/machine-learning/how-to-use-environments.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Add packages to an environment by using Conda, pip, or private wheel files. Spec
139139

140140
If a package is available in a Conda package repository, then we recommend that you use the Conda installation rather than the pip installation. Conda packages typically come with prebuilt binaries that make installation more reliable.
141141

142-
The following example adds to the environment. It adds version 0.21.3 of `scikit-learn`. It also adds the `pillow` package, `myenv`. The example uses the [`add_conda_package()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.conda_dependencies.condadependencies?view=azure-ml-py#add-conda-package-conda-package-) method and the [`add_pip_package()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.conda_dependencies.condadependencies?view=azure-ml-py#add-pip-package-pip-package-) method, respectively.
142+
The following example adds to the environment. It adds version 1.17.0 of `numpy`. It also adds the `pillow` package, `myenv`. The example uses the [`add_conda_package()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.conda_dependencies.condadependencies?view=azure-ml-py#add-conda-package-conda-package-) method and the [`add_pip_package()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.conda_dependencies.condadependencies?view=azure-ml-py#add-pip-package-pip-package-) method, respectively.
143143

144144
```python
145145
from azureml.core.environment import Environment
@@ -148,8 +148,11 @@ from azureml.core.conda_dependencies import CondaDependencies
148148
myenv = Environment(name="myenv")
149149
conda_dep = CondaDependencies()
150150

151-
# Installs scikit-learn version 0.21.3 conda package
152-
conda_dep.add_conda_package("scikit-learn==0.21.3")
151+
# Installs numpy version 1.17.0 conda package
152+
conda_dep.add_conda_package("numpy==1.17.0")
153+
154+
# Installs pillow package
155+
conda_dep.add_pip_package("pillow")
153156

154157
# Adds dependencies to PythonSection of myenv
155158
myenv.python.conda_dependencies=conda_dep

0 commit comments

Comments
 (0)