Hello !
Thank you for posting on Microsoft Learn.
The azure-ai-ml package is part of the Azure ML SDK v2, which should normally be preinstalled in that kernel. If it's missing, that's either:
- a bug or oversight in the latest AML image
- the wrong kernel/environment was activated in the Compute Instance.
Before assuming it's completely missing, in a new notebook cell, run:
!pip show azure-ai-ml
or :
import azure.ai.ml
print(azure.ai.ml.__version__)
If this fails, then yes it’s missing.
Then check which environment is active and what Azure packages are available.
!which python
!pip list | grep azure
This shows which Python environment is active and what Azure packages are available.
Azure often includes the SDK in the AzureML kernel/environment so as a workaround, try switching the notebook kernel to AzureML (not just Python 3.10) and test import azure.ai.ml.
In the Compute Instance terminal, you can list available Conda environments:
conda env list
Look for one like azureml_py310_sdkv2
. Then in your notebook, run:
!source activate azureml_py310_sdkv2 && python -c "import azure.ai.ml; print('OK')"
or switch the notebook kernel accordingly if available.