Azure Namespace Package
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.
Warnings
- deprecated 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.
- gotcha 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.
- breaking 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.
Install
-
pip install azure-nspkg
Imports
- azure
import azure
Quickstart
# This package primarily exists to ensure the 'azure' namespace is available.
# It does not provide direct functionality itself and is generally not needed.
# Modern Azure SDKs (e.g., azure-storage-blob) typically manage their own namespaces.
# To demonstrate its effect (though usually not necessary to install explicitly):
# 1. pip install azure-nspkg
# 2. pip install azure-storage-blob # (or any other azure-* SDK)
try:
import azure
print(f"Successfully imported top-level 'azure' namespace.")
# Note: azure.__version__ might not be available or meaningful for this package.
# You would typically then import from a specific Azure SDK:
# from azure.storage.blob import BlobClient
print("You can now import specific Azure SDK modules (e.g., azure.storage.blob).")
except ImportError:
print("Failed to import 'azure' namespace. This package or other azure-* SDKs might be missing.")