Create an environment

PHOTO EMBED

Fri Apr 08 2022 23:18:38 GMT+0000 (Coordinated Universal Time)

Saved by @wessim

from azureml.core import Workspace, Environment

# Curated environment
ws = Workspace.from_config()
myenv = Environment.get(workspace=ws, name="AzureML-Minimal")

# Local environeent
myenv = Environment("user-managed-env")
myenv.python.user_managed_dependencies = True
# You can choose a specific Python environment by pointing to a Python path 
# myenv.python.interpreter_path = '/home/johndoe/miniconda3/envs/myenv/bin/python'
content_copyCOPY

Azure Machine Learning environments are an encapsulation of the environment where your machine learning training happens. They specify the Python packages, Docker image, environment variables, and software settings around your training and scoring scripts. They also specify runtimes (Python, Spark, or Docker). You can either define your own environment, or use an Azure ML curated environment. Curated environments are predefined environments that are available in your workspace by default. These environments are backed by cached Docker images which reduces the run preparation cost. See Azure Machine Learning Curated Environments for the full list of available curated environments. If your compute target is your local machine, you are responsible for ensuring that all the necessary packages are available in the Python environment where the script runs. Use python.user_managed_dependencies to use your current Python environment (or the Python on the path you specify).

https://docs.microsoft.com/en-us/azure/machine-learning/how-to-set-up-training-targets