[Python] ImportError: Install adlfs to access Azure Datalake Gen2 and Azure Blob Storage even...

Discussão em 'Python' iniciado por Stack, Janeiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I have an azure function with code below:

    storage_account_url = f"{self.datalake_settings.STORAGE_ENDPOINT}/{parquet_folder_path}/{file_name}.parquet"
    storage_options = {
    "account_name": self.datalake_settings.STORAGE_ACCOUNT,
    "client_id": self.datalake_settings.RUNACCOUNT_ID,
    "client_secret": self.datalake_settings.RUNACCOUNT_KEY.get_secret_value(),
    "tenant_id": self.settings.TENANT_ID
    }

    df.to_parquet( storage_account_url, engine='pyarrow', compression='snappy', storage_options=storage_options )


    This is my requirements.txt:

    azure-functions
    azure-identity
    azure-storage-blob
    azure-monitor-opentelemetry
    opentelemetry-api
    opentelemetry-sdk
    opentelemetry-semantic-conventions
    pydantic
    adlfs
    azure-storage-blob
    azure-storage-file-datalake


    This is my .venv/lib: [​IMG]

    When I run this code I get following error:


    System.Private.CoreLib: Exception while executing function: Functions.get_exchangerates_trigger. System.Private.CoreLib: Result: Failure Exception: ImportError: Install adlfs to access Azure Datalake Gen2 and Azure Blob Storage
    ​

    Any ideas how to troubleshoot this? It clearly looks like the adlfs and blobstorage packages are installed.

    Continue reading...

Compartilhe esta Página