'Python AzureML Hello world - Can't find module azureml

Python 3.10, Pip install azureml-sdk 1.39.0.
Environments: Win10 PS, VS2022, and a docker image- all same results . Pip show shows the azureml-core package.

Simple (I thought) script, but it can't find "azureml.core" No module named azureml is the error. How do I make it "find" it? I'm new at python so it could be syntax.

import os
from azureml.core import Workspace, Experiment, Environment, Model,Dataset,Datastore,ScriptRunConfig
     
    # check core SDK version number
    print("Azure ML SDK Version: ", azureml.core.VERSION)


Solution 1:[1]

azureml python sdk does not support py3.10 yet, AutoML sdk supports py<=3.8.

Solution 2:[2]

Install

pip install azureml-core

Upgrade a previous version:

pip install --upgrade azureml-core

Verify your SDK version:

pip show azureml-core

To see all packages in your environment:

pip list

Below code to check the version

import azureml.core

print(azureml.core.VERSION)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vizhur
Solution 2 BhanunagasaiVamsi-MT