azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

compatibility issues between azure-core and azure-cli: cannot import name 'case_insensitive_dict' from 'azure.core.utils'

Open harneetvirk opened this issue 2 years ago • 13 comments

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

Describe the bug We are noticing compatibility issues between azure-core and azure-cli: cannot import name 'case_insensitive_dict' from 'azure.core.utils'. Until cli 2.37.0, AZ CLI had the dependency azure-core==1.21.1 Starting 2.38.0, AZ CLI is having dependency azure-core==1.24.0

In case, we install a package that has a direct or indirect dependency on the lower azure-core==1.21.1, the AZ CLI encounters the compatibility issues between azure-core and azure-cli and emits the error: cannot import name 'case_insensitive_dict' from 'azure.core.utils'

To Reproduce Two ways of reproducing the issue:

  1. Install latest az cli
  2. Install any package that depends on lower older version of azure-core

image

or

  1. Install az cli (2.37.0 or lower)
  2. Install cli ML extension 2.5.0. (ML Extension brings in the latest azure-storage-blob package that depends on latest azure-core=1.24.0). az extension add --name ml --version 2.5.0

Expected behavior CLI should not fail.

harneetvirk avatar Jul 19 '22 20:07 harneetvirk

@jiasli for awareness

yonzhan avatar Jul 19 '22 22:07 yonzhan

Good job

Ikaberry202 avatar Jul 20 '22 01:07 Ikaberry202

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

Issue Details

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

Describe the bug We are noticing compatibility issues between azure-core and azure-cli: cannot import name 'case_insensitive_dict' from 'azure.core.utils'. Until cli 2.37.0, AZ CLI had the dependency azure-core==1.21.1 Starting 2.38.0, AZ CLI is having dependency azure-core==1.24.0

In case, we install a package that has a direct or indirect dependency on the lower azure-core==1.21.1, the AZ CLI encounters the compatibility issues between azure-core and azure-cli and emits the error: cannot import name 'case_insensitive_dict' from 'azure.core.utils'

To Reproduce Two ways of reproducing the issue:

  1. Install latest az cli
  2. Install any package that depends on lower older version of azure-core

image

or

  1. Install az cli (2.37.0 or lower)
  2. Install cli ML extension 2.5.0. (ML Extension brings in the latest azure-storage-blob package that depends on latest azure-core=1.24.0). az extension add --name ml --version 2.5.0

Expected behavior CLI should not fail.

Author: harneetvirk
Assignees: jiasli, jsntcy
Labels:

Service Attention, Machine Learning, Installation, Auto-Assign

Milestone: Backlog

ghost avatar Jul 20 '22 02:07 ghost

The dependency on azure-core was bumped by https://github.com/Azure/azure-cli/pull/22676.

It's ml's responsibility to use latest azure-core.

Latest azure-storage-blob-12.13.0.zip downloaded from https://pypi.org/project/azure-storage-blob/#files has "azure-core<2.0.0,>=1.23.1" in setup.py.

    install_requires=[
        "azure-core<2.0.0,>=1.23.1",
        "msrest>=0.6.21",
        "cryptography>=2.1.4"
    ],

jiasli avatar Jul 20 '22 02:07 jiasli

ML has already shipped a mitigation for this issue in the following release 2.6.1 by pinning the azure-storage-blob. But this is one common issue that is being encountered outside the scope of the ML extension.

The failure may be encountered in 2 ways.

  1. With the new az cli (2.38.0) wherever the user packages have direct or indirect dependencies on the older version of azure-core.
  2. With older az cli (2.37.0 or less), if the user packages have direct or indirect dependencies on the latest azure-core. For e.g., using azure-storage-blob 12.13.0 with az cli 2.37.0 or less.

harneetvirk avatar Jul 20 '22 04:07 harneetvirk

We are also seeing this on az cli 2.37.0 and the latest version (0.5.92) of aks-preview extension.

https://dev.azure.com/AzureContainerUpstream/Azure%20Workload%20Identity/_build/results?buildId=52370&view=logs&j=3a3ff92c-2ab0-5cd5-ecad-e283f5e1d802&t=6d5f3379-e684-5896-70a5-701deb97a928

Pinning aks-preview to 0.5.87 resolved it.

sozercan avatar Aug 02 '22 16:08 sozercan

Another instance of this issue has been reported here: https://github.com/Azure/azure-cli-extensions/issues/5215

harneetvirk avatar Aug 08 '22 18:08 harneetvirk

Was this issue resolved? If yes, how? I am encountering the same error!

bhatsuchi08 avatar Sep 01 '22 18:09 bhatsuchi08

Bump as well as this is failing for me too.

sethreidnz avatar Sep 04 '22 21:09 sethreidnz

failing for me, three.

delbert avatar Sep 06 '22 18:09 delbert

failing for me, three.

i am using AMLs CI, so i just provisioned another CI and the problem goes away. i just have to avoid installing other software that will pull that dependency back in... :-(

delbert avatar Sep 06 '22 18:09 delbert

I am following this tutorial -> https://learn.microsoft.com/en-us/azure/machine-learning/v1/tutorial-pipeline-python-sdk

Getting error in train.oy ->

azure-ml-error.txt

Can you please help to resolve. Thanks

sarbaniAi avatar Sep 17 '22 14:09 sarbaniAi

Also getting this issue with Azure ML notebooks.

To fix the issue, I used:

%pip install azure-core==1.23.1

afogarty85 avatar Sep 22 '22 18:09 afogarty85

Hi, Is the issue is resolved? I'm also facing the same issue while importing a package. Currently My azure-core is a version of 1.26.0 so while executing the module using this version of azure-core it throws me an error image

So here by observing the error I get to know that module requires an azure-core of version <=1.22.1. So if downgrade the version to 1.22.1 or less than that, then I'm facing an error image

did anyone have the solution how to resolve the error and successfully import the module?

Uditanshu1612 avatar Oct 18 '22 09:10 Uditanshu1612