conda-forge / geopandas-feedstock

A conda-smithy repository for geopandas.
BSD 3-Clause "New" or "Revised" License
16 stars 14 forks source link

OSError: could not find or load spatialindex_c-64.dll #78

Closed danschef closed 4 years ago

danschef commented 4 years ago

When installing geopandas 0.7.0 from conda-forge into a Python 3.8.2 Windows environment - with python coming from the defaults channel, geopandas raises the following exception on import:

Python 3.8.2 (default, Mar 25 2020, 08:56:29) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import geopandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\danschef\Anaconda3\envs\geopandas\lib\site-packages\geopandas\__init__.py", line 1, in <module>
    from geopandas.geoseries import GeoSeries  # noqa
  File "C:\Users\danschef\Anaconda3\envs\geopandas\lib\site-packages\geopandas\geoseries.py", line 13, in <module>
    from geopandas.base import GeoPandasBase, _delegate_property
  File "C:\Users\danschef\Anaconda3\envs\geopandas\lib\site-packages\geopandas\base.py", line 17, in <module>
    from rtree.core import RTreeError
  File "C:\Users\danschef\Anaconda3\envs\geopandas\lib\site-packages\rtree\__init__.py", line 1, in <module>
    from .index import Rtree
  File "C:\Users\danschef\Anaconda3\envs\geopandas\lib\site-packages\rtree\index.py", line 6, in <module>
    from . import core
  File "C:\Users\danschef\Anaconda3\envs\geopandas\lib\site-packages\rtree\core.py", line 126, in <module>
    raise OSError("could not find or load %s" % lib_name)
OSError: could not find or load spatialindex_c-64.dll


Environment (conda list):

``` (geopandas) C:\Users\danschef>conda list # packages in environment at C:\Users\danschef\Anaconda3\envs\geopandas: # # Name Version Build Channel attrs 19.3.0 py_0 conda-forge boost-cpp 1.72.0 h0caebb8_0 conda-forge bzip2 1.0.8 hfa6e2cd_2 conda-forge ca-certificates 2020.4.5.1 hecc5488_0 conda-forge certifi 2020.4.5.1 py38h32f6830_0 conda-forge cfitsio 3.470 hfa6e2cd_2 conda-forge click 7.1.1 pyh8c360ce_0 conda-forge click-plugins 1.1.1 py_0 conda-forge cligj 0.5.0 py_0 conda-forge curl 7.68.0 h4496350_0 conda-forge expat 2.2.9 he025d50_2 conda-forge fiona 1.8.13 py38hb7fdc2d_0 conda-forge freetype 2.10.1 ha9979f8_0 conda-forge freexl 1.0.5 hd288d7e_1002 conda-forge gdal 3.0.4 py38hf01e392_3 conda-forge geopandas 0.7.0 py_1 conda-forge geos 3.8.1 he025d50_0 conda-forge geotiff 1.5.1 h58edbdd_9 conda-forge gettext 0.19.8.1 hb01d8f6_1002 conda-forge glib 2.58.3 py38hc0c2ac7_1002 conda-forge hdf4 4.2.13 hf8e6fe8_1003 conda-forge hdf5 1.10.5 nompi_ha405e13_1104 conda-forge icu 64.2 he025d50_1 conda-forge intel-openmp 2020.0 166 jpeg 9c hfa6e2cd_1001 conda-forge kealib 1.4.13 hd6dc3df_0 conda-forge krb5 1.16.4 hdd46e55_0 conda-forge libblas 3.8.0 15_mkl conda-forge libcblas 3.8.0 15_mkl conda-forge libcurl 7.68.0 h4496350_0 conda-forge libffi 3.2.1 h6538335_1007 conda-forge libgdal 3.0.4 h1d28743_3 conda-forge libiconv 1.15 hfa6e2cd_1006 conda-forge libkml 1.3.0 h7e985d0_1011 conda-forge liblapack 3.8.0 15_mkl conda-forge libnetcdf 4.7.4 nompi_hc957ea6_101 conda-forge libpng 1.6.37 hfe6a214_1 conda-forge libpq 12.2 h795e76a_0 conda-forge libspatialindex 1.9.3 he025d50_3 conda-forge libspatialite 4.3.0a h6fa312b_1037 conda-forge libssh2 1.8.2 h642c060_2 conda-forge libtiff 4.1.0 h885aae3_6 conda-forge libwebp 1.0.2 hfa6e2cd_5 conda-forge libxml2 2.9.10 h9ce36c8_0 conda-forge lz4-c 1.8.3 he025d50_1001 conda-forge m2w64-expat 2.1.1 2 m2w64-gcc-libgfortran 5.3.0 6 m2w64-gcc-libs 5.3.0 7 m2w64-gcc-libs-core 5.3.0 7 m2w64-gettext 0.19.7 2 m2w64-gmp 6.1.0 2 m2w64-libiconv 1.14 6 m2w64-libwinpthread-git 5.0.0.4634.697f757 2 m2w64-xz 5.2.2 2 mkl 2020.0 166 msys2-conda-epoch 20160418 1 munch 2.5.0 py_0 conda-forge numpy 1.18.1 py38ha749109_1 conda-forge openjpeg 2.3.1 h57dd2e7_3 conda-forge openssl 1.1.1f hfa6e2cd_0 conda-forge pandas 1.0.3 py38hbe40bda_0 conda-forge pcre 8.44 h6538335_0 conda-forge pip 20.0.2 py38_1 poppler 0.67.0 h1707e21_8 conda-forge poppler-data 0.4.9 1 conda-forge postgresql 12.2 hd6b8478_0 conda-forge proj 6.3.1 ha7a8c7b_1 conda-forge pyproj 2.6.0 py38hff69d4a_0 conda-forge python 3.8.2 h5fd99cc_0 python-dateutil 2.8.1 py_0 conda-forge python_abi 3.8 1_cp38 conda-forge pytz 2019.3 py_0 conda-forge rtree 0.9.4 py38h7ad75cc_1 conda-forge setuptools 46.1.3 py38_0 shapely 1.7.0 py38hbf43935_3 conda-forge six 1.14.0 py_1 conda-forge sqlite 3.31.1 he774522_0 tbb 2018.0.5 he980bc4_0 conda-forge tiledb 1.7.0 hffbbd95_2 conda-forge tk 8.6.10 hfa6e2cd_0 conda-forge vc 14.1 h0510ff6_4 vs2015_runtime 14.16.27012 hf0eaf9b_1 wheel 0.34.2 py38_0 wincertstore 0.2 py38_0 xerces-c 3.2.2 h6538335_1004 conda-forge xz 5.2.5 h2fa13f4_0 conda-forge zlib 1.2.11 h2fa13f4_1006 conda-forge zstd 1.4.4 hd8a0e53_2 conda-forge ```


Details about conda and system ( conda info ):

``` (geopandas) C:\Users\danschef>conda info active environment : geopandas active env location : C:\Users\danschef\Anaconda3\envs\geopandas shell level : 2 user config file : C:\Users\danschef\.condarc populated config files : conda version : 4.8.3 conda-build version : 3.18.11 python version : 3.7.7.final.0 virtual packages : base environment : C:\Users\danschef\Anaconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/win-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/win-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/msys2/win-64 https://repo.anaconda.com/pkgs/msys2/noarch package cache : C:\Users\danschef\Anaconda3\pkgs C:\Users\danschef\.conda\pkgs C:\Users\danschef\AppData\Local\conda\conda\pkgs envs directories : C:\Users\danschef\Anaconda3\envs C:\Users\danschef\.conda\envs C:\Users\danschef\AppData\Local\conda\conda\envs platform : win-64 user-agent : conda/4.8.3 requests/2.23.0 CPython/3.7.7 Windows/10 Windows/10.0.18362 administrator : False netrc file : None offline mode : False ```

This does not happen when Python is also installed from conda-forge, e.g., by using the following command:

conda create -n geopandas -c conda-forge python=3.8 geopandas

danschef commented 4 years ago

It seems like this can be solved by conda install -c conda-forge rtree=0.9.3. However, this does not install rtree from conda-forge but from pkgs/main.

ocefpaf commented 4 years ago

You cannot mix channels like that unless you really know what you are doing and are willing to deal with the incompatibilities.

Please check our docs for the recommended way to use conda-forge packages: https://conda-forge.org/docs/user/introduction.html#how-can-i-install-packages-from-conda-forge

cugbdxw1998 commented 3 years ago

I have the same problem,did you have been solved?

danschef commented 3 years ago

Yes, as @ocefpaf already wrote, you have to make sure not to mix packages from conda-forge and the defaults channel. Simply install both, python and geopandas, from conda-forge:

conda create -n geopandas_testenv -c conda-forge python=3.8 geopandas
(or conda create -n geopandas_testenv -c conda-forge geopandas to install the latest python)