Install Python geopandas failed

南笙酒味 提交于 2021-01-24 11:25:26

问题


I'm trying to install geopandas. Have the following setup:

  • Windows-64
  • Anaconda2 (64-bit)
  • Python 2.7

Have tried two things:

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\

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)

anaconda search -t conda geopandas

I then search for the version of geopandas suitable for my setup (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. Not sure how to proceed from here.


回答1:


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/)

First try to 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 (e.g. from Gohlke)
  2. Uninstall all OSGeo4W, GDAL, Fiona, pyproj, rtree and shapely packages
  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)
  4. Now you can pip install geopandas



回答2:


I found the best/fastest way to be: create environment w/ geopandas then install jupyter notebook e.g.

  • conda create -n python=3.6 geopandas
  • conda install jupyter notebook



回答3:


Try this code below:

conda install geopandas


来源:https://stackoverflow.com/questions/51095970/install-python-geopandas-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!