azure.ai.ml package missing from compute instance software version 25.06.10

bleeksiel_lhc 5 Reputation points
2025-07-04T12:18:45.1933333+00:00

I just created a new compute instance on Azure Machine Learning. It is running Compute instance software version: Linux 25.06.10 (current).

I can't run my notebooks or scripts because I get the error "ModuleNotFoundError: No module named 'azure.ai'". It doesn't matter which kernel I pick to run the code in. I don't recall having this problem previously.

You would think that the "Python 3.10 - SDK v2" kernel would have the packages installed since, you know, the entire point of the SDK is to be able to interact with Azure Machine Learning!

I CANNOT download and install packages, either through pip or conda because the corporate firewall prevents this. I also can't make SDK calls remotely from my own machine (see above) - it has to be done through AML studio.

Is this hopeless? Am I missing something or did something break with this new version of the software? I can't find any documentation on this.

Am I also correct that there is absolutely no mechanism to create an instance using a previous version of the compute instance software?

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,346 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 34,656 Reputation points Volunteer Moderator
    2025-07-04T13:47:20.76+00:00

    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.


  2. bleeksiel_lhc 5 Reputation points
    2025-07-08T06:22:38.4266667+00:00

    Here are the answers to what was asked:

    1. Compute instance software gets updated (maybe) once a month, so that is how long it may take before the problem is rectified.
    2. If a package is missing from the compute instance software, then you need to install it yourself.
    3. If you can't install packages because of the secure environment setup then you need to convince enterprise cybersecurity to relax its rules.
    4. No, you can't choose what software version is used when provisioning a new compute instance, nor can you revert to an older version.
    5. You can perform some tasks such as submitting jobs using azure CLI and the "az ml" command, which is working.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.