{"id":5582,"library":"azure-nspkg","title":"Azure Namespace Package","description":"The `azure-nspkg` library is an internal Microsoft Azure Namespace Package, currently at version 3.0.2. Its original purpose was to provide the top-level `azure` namespace for older Azure SDKs. It is rarely needed directly in modern applications as individual Azure SDK client libraries (e.g., `azure-storage-blob`, `azure-eventhub`) now manage their own namespaces and dependencies, making `azure-nspkg` largely obsolete for new development.","status":"deprecated","version":"3.0.2","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","namespace","internal","legacy","sdk"],"install":[{"cmd":"pip install azure-nspkg","lang":"bash","label":"Install the namespace package"}],"dependencies":[],"imports":[{"note":"`azure-nspkg` does not expose direct symbols; its purpose is to enable the `azure` top-level namespace for other Azure SDKs.","wrong":"from azure_nspkg import ...","symbol":"azure","correct":"import azure"}],"quickstart":{"code":"# This package primarily exists to ensure the 'azure' namespace is available.\n# It does not provide direct functionality itself and is generally not needed.\n# Modern Azure SDKs (e.g., azure-storage-blob) typically manage their own namespaces.\n\n# To demonstrate its effect (though usually not necessary to install explicitly):\n# 1. pip install azure-nspkg\n# 2. pip install azure-storage-blob # (or any other azure-* SDK)\n\ntry:\n    import azure\n    print(f\"Successfully imported top-level 'azure' namespace.\")\n    # Note: azure.__version__ might not be available or meaningful for this package.\n    \n    # You would typically then import from a specific Azure SDK:\n    # from azure.storage.blob import BlobClient\n    print(\"You can now import specific Azure SDK modules (e.g., azure.storage.blob).\")\nexcept ImportError:\n    print(\"Failed to import 'azure' namespace. This package or other azure-* SDKs might be missing.\")","lang":"python","description":"This example shows that after installing `azure-nspkg`, the top-level `azure` namespace becomes available, allowing imports from sub-packages like `azure.storage.blob`. However, for modern Azure SDKs, installing `azure-nspkg` explicitly is almost never required as the individual SDK packages (e.g., `azure-storage-blob`) handle namespace provision themselves."},"warnings":[{"fix":"For new projects, install specific client libraries (e.g., `pip install azure-storage-blob`, `pip install azure-identity`) directly. These libraries manage their own namespaces and dependencies without needing `azure-nspkg`.","message":"The `azure-nspkg` package is a legacy component and is generally not required for modern Azure SDKs (versions 2.0.0+). Its functionality is superseded by explicit namespace declarations within individual Azure client libraries.","severity":"deprecated","affected_versions":"All versions"},{"fix":"To use Azure services, you must install the specific client library for that service (e.g., `pip install azure-keyvault-secrets` for Key Vault Secrets, `pip install azure-eventhub` for Event Hubs).","message":"Installing `azure-nspkg` alone does not provide any Azure SDK functionality or client objects. It merely provides the top-level `azure` namespace, which by itself is inert.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure all Azure SDKs in your project are up-to-date and installed via their individual, modern package names (e.g., `azure-storage-blob` instead of `azure-storage`). Prefer a single, consistent set of modern SDKs to avoid namespace collisions.","message":"Mixing very old Azure SDKs that implicitly relied on `azure-nspkg` (e.g., `azure-storage` before v0.36) with newer SDKs that use explicit namespace packages (e.g., `azure-storage-blob`) can lead to import conflicts or unexpected behavior due to different ways of managing the `azure` namespace.","severity":"breaking","affected_versions":"< 2.0.0 (old SDKs) when mixed with modern SDKs"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}