TransWikia.com

When importing shp-file gives an error "No dataset found at path"

Geographic Information Systems Asked by Ivo on September 12, 2020

I’m trying to follow this tutorial to GeoPandas and am trying to import the "oceans.shp" file, which I downloaded from here (together with the .dbf, .prj, qpj, and .shx files),

When running the code

oceans = gpd.read_file('[...]oceans.shp')

I get the error

FionaValueError: No dataset found at path '[...]oceans.shp' using drivers: *

What am I doing wrong – can someone point me into the right direction?

One Answer

Are you sure you wrote the path properly?

If the file is in the same directory than the script, do this:

import os

oceans = gpd.read_file(os.path.join(os.getcwd(), 'oceans.shp')

Using os assures you that you won't have conflicts of paths when switching from windows to linux.

Answered by ImanolUr on September 12, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP