Python Geopandas无法找到Shapefile

问题描述

环境:

Python 3.8.6
Conda 4.8.5
Mac OS Catalina 10.15.7

试图读取ESRI shapefile,其中包含英国上层地方当局边界的python环境。在命令行和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 install出现同样的错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)