anaconda中安装geopandas遇到的问题
1.安装时报错
使用conda install geopandas安装geopandas库时会报错如下:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
在已有环境中安装新的库,conda要求检查已有环境的兼容性,时间很长,而且很可能最后失败。
网上查阅解决方法发现是conda自身的问题,使用conda update --all
命令也不一定能解决所有问题,没有较好的解决方法。
最后的手段:直接下一个miniconda,miniconda是基本全裸的没有包含其他包。此时xonda install geopandas 成功。
2.在vscode运行时报错oserror: could not find or load spatialindex_c-64.dll
出现这个问题的原因是geopandas引用的库rtree找不到spatialindex_c-64.dll导致的,直接在python安装路径lib下寻找spatialindex_c-64.dll,然后将其复制到Miniconda3\Lib\site-packages\rtree文件夹下即可。