我正在尝试使用以下代码将shapefile "Metropolin_31Jul_0921.shp“导入python:
import shapefile
stat_area_df = shapefile.Reader("Metropolin_31Jul_0921.shp")但是我一直收到这个错误:
File "C:\Users\maya\Anaconda3\lib\site-packages\shapefile.py", line 291,
in load
raise ShapefileException("Unable to open %s.dbf or %s.shp." %
(shapeName, shapeName) )
shapefile.ShapefileException: Unable to open Metropolin_31Jul_0921.dbf
or Metropolin_31Jul_0921.shp.有人知道这是什么意思吗?我尝试添加目录,但没有帮助。
发布于 2018-03-17 00:55:38
确保shapefile所在的目录包含所有支持文件,如.dbf、.shx等。如果没有这些支持文件,.shp将无法工作。
https://stackoverflow.com/questions/48051810
复制相似问题