3

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.

Saud
  • 480
  • 1
  • 9
  • 26
  • You can install geopandas from the main channel: `conda install geopandas`. But make sure to first remove all versions of geopandas (and its dependencies shapely and fiona) that you installed from the other channel or with pip. – joris Jun 29 '18 at 07:06
  • How do I uninstall geopandas and its dependencies shapely and fiona? `conda uninstall geopandas` produces the error: PackagesNotFound: The following packages are missing from the target environment: - geopandas – Saud Jun 29 '18 at 12:21
  • To uninstall the pip version, you can do eg `pip uninstall geopandas shapely fiona` – joris Jun 29 '18 at 14:11
  • The output from that command is: `Skipping fiona as it is not installed Skipping geopandas as it is not installed Skipping shapely as it is not installed` – Saud Jun 29 '18 at 14:17
  • When I run the command `conda install geopandas` I get the same error message as in 2) – Saud Jun 29 '18 at 14:21
  • Any other suggestions? :) – Saud Jul 06 '18 at 07:47
  • 1
    So geopandas is actually available for window 64 and python 2.7, so if you get the error you mention, there is clearly going something wrong (you could open an issue about that on the Anaconda tracker). But can you try `conda create -n test python=2.7 geopandas -c defaults` to create a fresh environment with geopandas to see if at least that works? – joris Jul 07 '18 at 03:33
  • Still not working. When I import geopandas in the ipynb file, it can't recognize geopandas. – Saud Jul 09 '18 at 14:19
  • Can you first check in a python console if you can import geopandas? In the notebook you need to ensure that you are using the correct python kernel (either install notebook in the new environment and start it from there, or either register the environment as a kernel (https://ipython.readthedocs.io/en/stable/install/kernel_install.html)) – joris Jul 09 '18 at 14:31
  • Did the following: `python2 -m pip --version` (=> ver. greater than 9) `python2 -m pip install ipykernel` `python2 -m ipykernel install --user`. The output is: `Installed kernelspec python2 in C:\Users\User\...\jupyter\kernels\python2` Geopandas is still not recognized. – Saud Jul 09 '18 at 14:38

3 Answers3

8

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
0

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
0

Try this code below:

conda install geopandas
MGB.py
  • 461
  • 2
  • 9
  • 25