I want to use add some packages to the environment for AzureML environment. What is the way for that?
Asked
Active
Viewed 197 times
1 Answers
-1
There are multiple way for creating the environment for experiment.
from azureml.core.conda_dependencies import CondaDependencies
Create a Python environment for the experiment
my_env = Environment("my-env")
Ensure the required packages are installed
packages = CondaDependencies.create(conda_packages=['pandas','numpy'],
pip_packages=['mlflow','azureml-mlflow'])
my_env.python.conda_dependencies = packages
Then, we can use this env as follows:
Create a script config
script_config = ScriptRunConfig(source_directory=experiment_folder,
script='training_script.py',
environment=my_env)
submit the experiment
experiment = Experiment(workspace=ws, name='my_experiment)
run = experiment.submit(config=script_config)
RunDetails(run).show()
run.wait_for_completion()

Saurabh Kansal
- 643
- 5
- 13