简体   繁体   English

安装 Python geopandas 失败

[英]Install Python geopandas failed

I'm trying to install geopandas.我正在尝试安装 geopandas。 Have the following setup:进行以下设置:

  • Windows-64视窗-64
  • Anaconda2 (64-bit) Anaconda2(64 位)
  • Python 2.7蟒蛇 2.7

Have tried two things:尝试了两件事:

1) 1)

pip install geopandas

This gives me the following error:这给了我以下错误:

WindowsError: [Error 126] The specified module could not be found and Command "python setup.py egg_info" failed with error code 1 in c:\\users\\username\\appdata\\local\\temp\\pip-install-_kgeyw\\shapely\\ WindowsError: [Error 126] The specified module could not be foundCommand "python setup.py egg_info" failed with error code 1 in c:\\users\\username\\appdata\\local\\temp\\pip-install-_kgeyw\\shapely\\

The solutions to the similar problem here suggest that it's because of the slashes in the path being converted. 此处类似问题的解决方案表明,这是因为正在转换的路径中的斜线。 Not sure how to test this.不知道如何测试这个。

2) 2)

anaconda search -t conda geopandas

I then search for the version of geopandas suitable for my setup (Windows-64):然后我搜索适合我的设置的 geopandas 版本(Windows-64):

conda install -c maxalbert geopandas

which produces the following error:这会产生以下错误:

UnsatisfiableError: The following specifications were found to be in conflict:
 - geopandas
Use "conda info <package> to see the dependencies for each package

When I run the command conda info geopandas I get a list of geopandas version.当我运行命令conda info geopandas我会得到一个 geopandas 版本列表。 Not sure how to proceed from here.不知道如何从这里开始。

It is a common problem and the solution is to install all dependencies manually (as Geoff Boeing describes here: https://geoffboeing.com/2014/09/using-geopandas-windows/ )这是一个常见问题,解决方案是手动安装所有依赖项(如 GeoffBoeing 在这里描述的那样: https : //geoffboeing.com/2014/09/using-geopandas-windows/

First try to conda install -c conda-forge geopandas .首先尝试conda install -c conda-forge geopandas If it doesn't work, do the following steps:如果不起作用,请执行以下步骤:

  1. Download wheels for your Python version and OS for GDAL, Fiona, pyproj, rtree and shapely (eg from Gohlke)下载适用于 GDAL、Fiona、pyproj、rtree 和 shapely(例如来自 Gohlke)的 Python 版本和操作系统的轮子
  2. Uninstall all OSGeo4W, GDAL, Fiona, pyproj, rtree and shapely packages卸载所有 OSGeo4W、GDAL、Fiona、pyproj、rtree 和 shapely 包
  3. pip install the downloaded wheels in the following order: GDAL, Fiona, pyproj, rtree and shapely (for example pip install GDAL-1.11.2-cp27-none-win_amd64.whl ) pip install按照以下顺序pip install下载的轮子:GDAL、Fiona、pyproj、rtree 和 shapely(例如pip install GDAL-1.11.2-cp27-none-win_amd64.whl
  4. Now you can pip install geopandas现在你可以pip install geopandas

I found the best/fastest way to be: create environment w/ geopandas then install jupyter notebook eg我发现最好/最快的方法是:使用 geopandas 创建环境然后安装 jupyter notebook 例如

  • conda create -n python=3.6 geopandas conda create -n python=3.6 geopandas
  • conda install jupyter notebook conda 安装 jupyter 笔记本

试试下面的代码:

conda install geopandas

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM