geopandas read_file函数导致Importerror

发布于 2025-02-09 16:46:36 字数 692 浏览 2 评论 0原文

我刚刚得到了一台新计算机,在下载了最新版本的Anaconda发行版后,我尝试安装地理杂质并运行脚本。 但是,GPD.Read_file命令会导致Importerror。 我一直在试图重新安装一切,但没有任何改变。 有人知道如何解决这个问题吗?

import geopandas as gpd

path = "C:/someshapefile.shp"

gpd.read_file(path)
ImportError: The 'read_file' function requires the 'pyogrio' or
'fiona' package, but neither is installed or imports correctly. 

进口Fiona导致:

DLL load failed while importing ogrext: The specified module could not be found.

导入Pyogrio导致:

No module named 'pyogrio'

像这样手动安装Fiona:

conda install -c conda-forge fiona

不幸的是对我不起作用。

多谢! 厘米

I just got a new computer and after downloading the newest version of the anaconda distribution I tried to install geopandas and run my script.
However, the gpd.read_file command causes an ImportError.
I have been trying to reinstall everything but nothing changed.
Does anybody know how to figure this out?

import geopandas as gpd

path = "C:/someshapefile.shp"

gpd.read_file(path)
ImportError: The 'read_file' function requires the 'pyogrio' or
'fiona' package, but neither is installed or imports correctly. 

Importing fiona resulted in:

DLL load failed while importing ogrext: The specified module could not be found.

Importing pyogrio resulted in:

No module named 'pyogrio'

Just installing fiona manually like this:

conda install -c conda-forge fiona

did unfortunately not work for me.

Thanks a lot!
CM

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奈何桥上唱咆哮 2025-02-16 16:46:36

git issue comment

python -m pip install git+https://github.com/Toblerity/Fiona.git

working for me

怂人 2025-02-16 16:46:36

我正在使用Microforge(基本上是带有Conda-Forge默认值的Microconda)。对我有用的唯一解决方案是创建一个新的环境,将Python版本设置为3.8,然后再次安装所有软件包。

conda create -n myenv python=3.8

我在此YouTube视频中找到了解决方案: https://wwwww.youtube.com/watch? = XQB4ZITM6K4

我不确定为什么会起作用,但我相信GDAL的较新版本存在问题。

I'm using microforge (basically microconda with conda-forge defaults). The only solution that worked for me was to create a new environment with python version set to 3.8, and then install all packages again.

conda create -n myenv python=3.8

I found the solution in this youtube video: https://www.youtube.com/watch?v=xqB4ZItm6k4

I'm not exactly sure why this works but I believe there is an issue with newer versions of GDAL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文