azure machine learning environment discrepancy between conda_dependencies and the machine learning portal

Stokes, John (Allianz UK) 0 Reputation points
2025-08-05T12:51:14.8566667+00:00

I deploy live machine learning endpoint to AKS via the machine learning python SDK v1. it is not currently possible for me to upgrade to SDK v2, so I'm specifically looking for support with the older (still supported) version.

when deploying, I set the conda dependencies from an env.yml file with the following code:

conda_dependencies = CondaDependencies(
	conda_dependencies_file_path=<PATH TO FILE>,
	_underlying_structure=None
)
conda_dependencies.set_pip_option(
	"--extra-index-url <MY PYPI MIRROR>"
)
python.conda_dependencies = conda_dependencies

once deployed, I can use the following code to poll the python version of the live application:

ws = Workspace(
	subscription_id=subscription_id,
	resource_group=resource_group,
	workspace_name=workspace,
)
service = Webservice(workspace=self.ws, name=service_name)
environment = service.environment

python_version = environment.python.conda_dependencies.get_python_version()
print(python_version)

>>> "3.10.12"

and see it return the python version as 3.10.12, as defined in my env.yml.

when i look on the azureml studio portal however, i see in the environment definition, the conda file lists the python version as "3.9.16".

on top of this, when i exec into the aml pod, i see the python version as 3.9.16, and that even the python interpreter in the azureml subdirectory is 3.9.

why is the python version in the pod / portal different from the one that is returned when using the SDK to poll the endpoint? which is the correct version? and why is there a difference in the first place?

cheers,

John

Azure Machine Learning
0 comments No comments
{count} votes

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.