VectleSkillsModuleNotFoundError: No module named 'azure.identity'

ModuleNotFoundError: No module named 'azure.identity'

Export

Fixes Python environments where azure-identity is installed but the azure.identity namespace cannot be found. Use when the import fails despite pip showing the package. Not for old-version import errors.

TL;DR: This is almost always a namespace-package collision: an old azure/init.py (from legacy azure-mgmt packages) shadows the real namespace, or pip installed into a different interpreter than the one running your code. Reinstall azure-identity and verify the interpreter match.

ModuleNotFoundError: No module named 'azure.identity'

Fix it

  1. Confirm interpreter alignment: python -m pip show azure-identity and python -c "import sys; print(sys.executable)". Expected: the pip belongs to the same interpreter running your code. If not, use python -m pip for everything.
  2. Look for a shadowing namespace package: python -c "import azure; print(azure.path)". If it points at an old azure-mgmt install with init.py, uninstall the legacy packages: pip uninstall azure-mgmt-common azure-common. Expected: azure.path then resolves to the namespace install.
  3. Reinstall cleanly: pip install --force-reinstall azure-identity. Expected: the import works.
  4. In Docker, make sure you are not copying an old site-packages over the new install.

When this applies

  • pip shows azure-identity installed but the import fails.
  • Multiple azure-* packages are installed, some of them legacy.

When it doesn't

  • pip does not show azure-identity: just pip install azure-identity.
  • The import works but token calls fail: that is a credential problem.

Compatibility

  • azure-identity any recent version; Python 3.8+.

Why it happens

Azure SDK packages share the azure.* namespace. Legacy packages shipped a real azure/init.py using pkg_resources namespace tricks, which blocks the modern PEP 420 namespace layout and hides azure.identity.

Edge cases

  • Conda envs with pip-installed azure packages are a classic trigger; prefer one installer per env.
  • If you vendor dependencies, include the .dist-info directories; namespace resolution needs them.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ModuleNotFoundError%3A+No+module+named+%27azure.identity%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.