Python Geopandas无法定位Shapefile

2024-05-07 06:41:18 发布

您现在位置:Python中文网/ 问答频道 /正文

环境:

Python 3.8.6
Conda 4.8.5
Mac OS Catalina 10.15.7

试图在python环境中读取英国上层地方当局边界的ESRI shapefile。在命令行和PyCharm中尝试,但出现相同错误

设置以下文档指南:

conda create -n geo_env
conda activate geo_env
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install python=3 geopandas

我已经确认所有依赖项包(fiona、pyproj、shapely、dumpy、pandas)都已安装并导入到环境中

但在运行以下命令时:

local_auth_shape = gpd.read_file('~/Downloads/Counties_and_Unitary_Authorities__December_2017__Boundaries_GB-shp/Counties_and_Unitary_Authorities__December_2017__Boundaries_GB.shp')

我遇到了以下错误:

fiona.errors.DriverError: ~/Downloads/Counties_and_Unitary_Authorities__December_2017__Boundaries_GB-shp/Counties_and_Unitary_Authorities__December_2017__Boundaries_GB.shp: No such file or directory

路径是正确的,我已经对它进行了三次检查。地理数据库文件夹也已下载,没有错误

我也尝试过使用pip安装,但也出现了相同的错误


Tags: andenvconfig环境错误condageofiona