geopandas read_file issue

Dawood Shaikh, Shoaibakhtar 0 Reputation points
2023-02-27T10:49:14.57+00:00

I am trying to read a shapefile from azure data lake storage using abfss protocol

path=abfss://<container-name>@<storage account-name>.dfs.core.windows.net/<path/to/shapefile>/shapefile.shp

I am using geopandas library to read the contents of shapefile

df=geopandas.read_file(path)

It throws me error ERROR:fiona._env:abfss://<container-name>@<storage account-name>.dfs.core.windows.net/<path/to/shapefile>/shapefile.shp: No such file or directory

DriverError: abfss://<container-name>@<storage account-name>.dfs.core.windows.net/<path/to/shapefile>/shapefile.shp: No such file or directory

I was able to read a csv file from the same storage

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
1,545 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,297 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SaiKishor-MSFT 16,656 Reputation points Microsoft Employee
    2023-03-06T19:24:16.2433333+00:00

    @Dawood Shaikh, Shoaibakhtar Thanks for reaching out to Microsoft Q&A.

    The error message you are encountering is indicating that the shapefile you are trying to read is not found in the specified location.

    It is possible that the path to the shapefile is incorrect or the shapefile is not present in the specified location.

    You can try the following steps to resolve the issue:

    1. Verify the path to the shapefile is correct- https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri
    2. Verify that the shapefile is present in the specified location.
    3. If the shapefile is present in the specified location, try accessing it using the Azure portal or Azure Storage Explorer to confirm that the shapefile is accessible.
    4. If the shapefile is not accessible, check the permissions on the shapefile and the container to ensure that you have the necessary permissions to access the shapefile.
    5. If the issue persists, you can try using the fiona library to read the shapefile instead of geopandas.

    If you are still encountering issues, you can try reaching out to the Azure support team for further assistance.

    Hope this helps. Please do let us know if you have any further questions. Thank you!