Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import name 'CaseInsensitiveDict' from 'azure.core.utils' when installing az extension #27380

Open
huliang-microsoft opened this issue Sep 13, 2023 · 6 comments
Assignees
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. DevOps Installation Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Milestone

Comments

@huliang-microsoft
Copy link

Describe the bug

Hi Azure Cli team,
We are using Azure Devops to build our service and we started to see this failure when we tried to install extensions:

sudo az extension add --name quota --version 0.1.0 -y
cannot import name 'CaseInsensitiveDict' from 'azure.core.utils' (/opt/az/lib/python3.10/site-packages/azure/core/utils/init.py)

We installed azure cli with:
sudo apt-get install -y --allow-downgrades azure-cli=2.39.0-1~focal

The previous successful pipeline runs are also 2.39.0-1 so I dont know what changed.

Thanks

Related command

sudo az extension add --name quota --version 0.1.0 -y

Errors

cannot import name 'CaseInsensitiveDict' from 'azure.core.utils' (/opt/az/lib/python3.10/site-packages/azure/core/utils/init.py)

Issue script & Debug output

cannot import name 'CaseInsensitiveDict' from 'azure.core.utils' (/opt/az/lib/python3.10/site-packages/azure/core/utils/init.py)

Expected behavior

The package should be installed

Environment Summary

azure-cli 2.39.0-1

Additional context

No response

@huliang-microsoft huliang-microsoft added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Sep 13, 2023
@azure-client-tools-bot-prd
Copy link

Hi @huliang-microsoft,

2.39.0 is not the latest Azure CLI(2.52.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 13, 2023

Thank you for opening this issue, we will look into it.

@azure-client-tools-bot-prd
Copy link

Hi @huliang-microsoft
Find similar issue #23267.

Issue title compatibility issues between azure-core and azure-cli: cannot import name 'case_insensitive_dict' from 'azure.core.utils'
Create time 2022-07-19
Comment number 14

Possible solution:
The error message "cannot import name 'CaseInsensitiveDict' from 'azure.core.utils'" is caused by compatibility issues between azure-core and azure-cli. 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 fix the issue, you can try installing azure-core==1.23.1 by running %pip install azure-core==1.23.1.


Please confirm if this resolves your issue.

@yonzhan yonzhan added DevOps CXP Attention This issue is handled by CXP team. labels Sep 13, 2023
@yonzhan yonzhan added this to the Backlog milestone Sep 13, 2023
@microsoft-github-policy-service
Copy link
Contributor

Thank you for your feedback. This has been routed to the support team for assistance.

@ManuK001
Copy link

ManuK001 commented Sep 27, 2023

Hi @huliang-microsoft!
Az 2.39 is bit old now compared 2.52.
I helped resolve a similar issue recently from customer by suggesting him to "Az upgrade" and add Az ML extension after removal. Could you confirm it from your side.

  1. az upgrade
  2. az extension remove -n azure-cli-ml
  3. az extension remove -n ml
  4. az extension add -n ml

Reference - #21390
Thank you.

@PramodValavala-MSFT PramodValavala-MSFT added Service Attention This issue is responsible by Azure service team. and removed CXP Attention This issue is handled by CXP team. labels Sep 28, 2023
@microsoft-github-policy-service
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @v-anvashist, @V-hmusukula.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Auto-Resolve Auto resolve by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. DevOps Installation Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue
Projects
None yet
Development

No branches or pull requests

5 participants