为什么我不能导入大 pandas ? [英] why can't I import geopandas?

查看:182
本文介绍了为什么我不能导入大 pandas ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我唯一的代码行是

import geopandas

它给了我错误

OSError: Could not find libspatialindex_c library file

以前有人遇到过吗?在出现此错误之前,我的脚本运行正常.

has anyone encountered this before? my script was working just fine until this error came up.

**请注意,找不到rtree模块是一个问题,在安装时我收到了上述错误.

**Note that rtree module not found was an issue fisrt, and upon installation I received the above error instead.

推荐答案

在Windows 10的Linux子系统中工作时,我遇到了同样的问题(说

I had the same issue while working in Linux Subsystem at Windows 10 (speaking about this). What helped was installing the version for developers using apt. Namely:

sudo apt install libspatialindex-dev完成了工作.

我不需要使用make.

edit:很高兴看到我的答案被否决了很多次;然而,在撰写本文时,这不是最受欢迎的答案,并且先于其他使用make提出的答案.这就是为什么我指的是这个命令.而且我认为其他答案仍然值得一读.

edit: Nice to see my answer has been upvoted so many times; in the time of writing it, however, this was not the most popular answer and it was preceeded by the other answers that suggested using make. This is why I am referring to this command; and I think the other answers are worth reading anyway.

这篇关于为什么我不能导入大 pandas ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆