conda-forge / geopandas-feedstock

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

Error when importing geopandas: ImportError: libpoppler.so.76 #48

Closed josemarfdc closed 5 years ago

josemarfdc commented 5 years ago

Issue: Importing geopandas fails on a clean environment

Since I don't need poppler, I installed geopandas using pip and it works just fine, but without poppler.

<myuser>@<mymachine>:~$ conda activate TEST
(TEST) <myuser>@<mymachine>:~$ python 
Python 3.7.1 | packaged by conda-forge | (default, Feb 26 2019, 04:48:14) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import geopandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/<myuser>/anaconda3/envs/TEST/lib/python3.7/site-packages/geopandas/__init__.py", line 4, in <module>
    from geopandas.io.file import read_file
  File "/home/<myuser>/anaconda3/envs/TEST/lib/python3.7/site-packages/geopandas/io/file.py", line 3, in <module>
    import fiona
  File "/home/<myuser>/anaconda3/envs/TEST/lib/python3.7/site-packages/fiona/__init__.py", line 83, in <module>
    from fiona.collection import BytesCollection, Collection
  File "/home/<myuser>/anaconda3/envs/TEST/lib/python3.7/site-packages/fiona/collection.py", line 9, in <module>
    from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: libpoppler.so.76: cannot open shared object file: No such file or directory


Environment (conda list):

```bash $ conda list # packages in environment at /home//anaconda3/envs/TEST: # # Name Version Build Channel attrs 18.2.0 py_0 conda-forge blas 1.0 mkl boost-cpp 1.68.0 h11c811c_1000 conda-forge bzip2 1.0.6 h14c3975_1002 conda-forge ca-certificates 2018.11.29 ha4d7672_0 conda-forge cairo 1.14.12 h8948797_3 certifi 2018.11.29 py37_1000 conda-forge click 7.0 py_0 conda-forge click-plugins 1.0.4 py_0 conda-forge cligj 0.5.0 py_0 conda-forge curl 7.64.0 h646f8bb_2 conda-forge cycler 0.10.0 py_1 conda-forge dbus 1.13.6 h746ee38_0 descartes 1.1.0 py_2 conda-forge expat 2.2.6 he6710b0_0 fiona 1.8.4 py37heb36068_1001 conda-forge fontconfig 2.13.0 h9420a91_0 freetype 2.9.1 h94bbf69_1005 conda-forge freexl 1.0.5 h14c3975_1002 conda-forge gdal 2.3.3 py37hbb2a789_0 geopandas 0.4.0 py_1 conda-forge geos 3.7.1 hf484d3e_1000 conda-forge gettext 0.19.8.1 h9745a5d_1001 conda-forge giflib 5.1.4 h14c3975_1001 conda-forge glib 2.56.2 had28632_1001 conda-forge gst-plugins-base 1.14.0 hbbd80ab_1 gstreamer 1.14.0 hb453b48_1 hdf4 4.2.13 h9a582f1_1002 conda-forge hdf5 1.10.4 nompi_h11e915b_1105 conda-forge icu 58.2 hf484d3e_1000 conda-forge intel-openmp 2019.1 144 jpeg 9c h14c3975_1001 conda-forge json-c 0.13.1 h14c3975_1001 conda-forge kealib 1.4.10 he7154bc_1002 conda-forge kiwisolver 1.0.1 py37h6bb024c_1002 conda-forge krb5 1.16.3 h05b26f9_1001 conda-forge libcurl 7.64.0 h541490c_2 conda-forge libdap4 3.19.1 0 conda-forge libedit 3.1.20170329 hf8c457e_1001 conda-forge libffi 3.2.1 hf484d3e_1005 conda-forge libgcc-ng 7.3.0 hdf63c60_0 conda-forge libgdal 2.3.3 h2e7e64b_0 libgfortran-ng 7.2.0 hdf63c60_3 conda-forge libiconv 1.15 h14c3975_1004 conda-forge libkml 1.3.0 h328b03d_1009 conda-forge libnetcdf 4.6.2 hbdf4f91_1001 conda-forge libpng 1.6.36 h84994c4_1000 conda-forge libpq 11.1 h20c2e04_0 libspatialindex 1.8.5 hf484d3e_1003 conda-forge libspatialite 4.3.0a hb5ec416_1026 conda-forge libssh2 1.8.0 h90d6eec_1004 conda-forge libstdcxx-ng 7.3.0 hdf63c60_0 conda-forge libtiff 4.0.10 h648cc4a_1001 conda-forge libuuid 1.0.3 1 conda-forge libxcb 1.13 h14c3975_1002 conda-forge libxml2 2.9.8 h143f9aa_1005 conda-forge matplotlib 3.0.3 py37_0 conda-forge matplotlib-base 3.0.3 py37h167e16e_0 conda-forge mkl 2019.1 144 mkl_fft 1.0.10 py37h14c3975_1 conda-forge mkl_random 1.0.2 py37h637b7d7_2 conda-forge munch 2.3.2 py_0 conda-forge ncurses 6.1 hf484d3e_1002 conda-forge numpy 1.15.4 py37h7e9f1db_0 numpy-base 1.15.4 py37hde5b4d6_0 openjpeg 2.3.0 hf38bd82_1003 conda-forge openssl 1.1.1b h14c3975_0 conda-forge palettable 3.1.1 py_0 conda-forge pandas 0.24.1 py37hf484d3e_0 conda-forge patsy 0.5.1 py_0 conda-forge pcre 8.42 h439df22_0 pip 19.0.3 py37_0 conda-forge pixman 0.34.0 h14c3975_1003 conda-forge poppler 0.72.0 h2fc8fa2_1000 conda-forge poppler-data 0.4.9 1 conda-forge proj4 5.2.0 h14c3975_1001 conda-forge psycopg2 2.7.6.1 py37h1ba5d50_0 pthread-stubs 0.4 h14c3975_1001 conda-forge pyparsing 2.3.1 py_0 conda-forge pyproj 1.9.6 py37hc0953d3_1000 conda-forge pyqt 5.6.0 py37h13b7fb3_1008 conda-forge pysal 2.0.0 py_0 conda-forge python 3.7.1 h381d211_1002 conda-forge python-dateutil 2.8.0 py_0 conda-forge pytz 2018.9 py_0 conda-forge qt 5.6.3 h8bf5577_3 readline 7.0 hf8c457e_1001 conda-forge rtree 0.8.3 py37_1000 conda-forge scipy 1.2.1 py37h7c811a0_0 seaborn 0.9.0 py_0 conda-forge setuptools 40.8.0 py37_0 conda-forge shapely 1.6.4 py37h092830f_1002 conda-forge sip 4.18.1 py37hf484d3e_1000 conda-forge six 1.12.0 py37_1000 conda-forge sqlalchemy 1.2.18 py37h14c3975_0 conda-forge sqlite 3.26.0 h67949de_1000 conda-forge statsmodels 0.9.0 py37h3010b51_1000 conda-forge tk 8.6.9 h84994c4_1000 conda-forge tornado 5.1.1 py37h14c3975_1000 conda-forge util-linux 2.21 0 wheel 0.33.1 py37_0 conda-forge xerces-c 3.2.2 hac72e42_1001 conda-forge xorg-libxau 1.0.9 h14c3975_0 conda-forge xorg-libxdmcp 1.1.2 h14c3975_1007 conda-forge xz 5.2.4 h14c3975_1001 conda-forge zlib 1.2.11 h14c3975_1004 conda-forge ```


Details about conda and system ( conda info ):

``` $ conda info active environment : TEST active env location : /home//anaconda3/envs/TEST shell level : 1 user config file : /home//.condarc populated config files : /home//.condarc conda version : 4.6.7 conda-build version : 3.17.6 python version : 3.7.1.final.0 base environment : /home//anaconda3 (writable) channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch package cache : /home//anaconda3/pkgs /home//.conda/pkgs envs directories : /home//anaconda3/envs /home//.conda/envs platform : linux-64 user-agent : conda/4.6.7 requests/2.21.0 CPython/3.7.1 Linux/4.4.0-142-generic ubuntu/16.04.3 glibc/2.23 UID:GID : 1000:1000 netrc file : None offline mode : False ```

This is clean environment that was created with the following:

```bash $ conda create --yes --name TEST python=3.7 geopandas --channel conda-forge Collecting package metadata: done Solving environment: done ## Package Plan ## environment location: /home//anaconda3/envs/TEST added / updated specs: - geopandas - python=3.7 The following packages will be downloaded: package | build ---------------------------|----------------- blas-1.0 | mkl 6 KB curl-7.64.0 | h646f8bb_2 143 KB conda-forge dbus-1.13.6 | h746ee38_0 587 KB fiona-1.8.4 |py37heb36068_1001 1.0 MB conda-forge gdal-2.3.3 | py37hbb2a789_0 1.3 MB krb5-1.16.3 | h05b26f9_1001 1.4 MB conda-forge libcurl-7.64.0 | h541490c_2 573 KB conda-forge libdap4-3.19.1 | 0 15.6 MB conda-forge libedit-3.1.20170329 | hf8c457e_1001 172 KB conda-forge libgdal-2.3.3 | h2e7e64b_0 17.7 MB libpq-11.1 | h20c2e04_0 2.6 MB libssh2-1.8.0 | h90d6eec_1004 245 KB conda-forge libuuid-1.0.3 | 1 34 KB conda-forge matplotlib-3.0.3 | py37_0 6 KB conda-forge numpy-1.15.4 | py37h7e9f1db_0 47 KB poppler-0.72.0 | h2fc8fa2_1000 12.1 MB conda-forge psycopg2-2.7.6.1 | py37h1ba5d50_0 308 KB pthread-stubs-0.4 | h14c3975_1001 5 KB conda-forge util-linux-2.21 | 0 35 KB ------------------------------------------------------------ Total: 53.8 MB The following NEW packages will be INSTALLED: attrs conda-forge/noarch::attrs-18.2.0-py_0 blas pkgs/main/linux-64::blas-1.0-mkl boost-cpp conda-forge/linux-64::boost-cpp-1.68.0-h11c811c_1000 bzip2 conda-forge/linux-64::bzip2-1.0.6-h14c3975_1002 ca-certificates conda-forge/linux-64::ca-certificates-2018.11.29-ha4d7672_0 cairo pkgs/main/linux-64::cairo-1.14.12-h8948797_3 certifi conda-forge/linux-64::certifi-2018.11.29-py37_1000 click conda-forge/noarch::click-7.0-py_0 click-plugins conda-forge/noarch::click-plugins-1.0.4-py_0 cligj conda-forge/noarch::cligj-0.5.0-py_0 curl conda-forge/linux-64::curl-7.64.0-h646f8bb_2 cycler conda-forge/noarch::cycler-0.10.0-py_1 dbus pkgs/main/linux-64::dbus-1.13.6-h746ee38_0 descartes conda-forge/noarch::descartes-1.1.0-py_2 expat pkgs/main/linux-64::expat-2.2.6-he6710b0_0 fiona conda-forge/linux-64::fiona-1.8.4-py37heb36068_1001 fontconfig pkgs/main/linux-64::fontconfig-2.13.0-h9420a91_0 freetype conda-forge/linux-64::freetype-2.9.1-h94bbf69_1005 freexl conda-forge/linux-64::freexl-1.0.5-h14c3975_1002 gdal pkgs/main/linux-64::gdal-2.3.3-py37hbb2a789_0 geopandas conda-forge/noarch::geopandas-0.4.0-py_1 geos conda-forge/linux-64::geos-3.7.1-hf484d3e_1000 gettext conda-forge/linux-64::gettext-0.19.8.1-h9745a5d_1001 giflib conda-forge/linux-64::giflib-5.1.4-h14c3975_1001 glib conda-forge/linux-64::glib-2.56.2-had28632_1001 gst-plugins-base pkgs/main/linux-64::gst-plugins-base-1.14.0-hbbd80ab_1 gstreamer pkgs/main/linux-64::gstreamer-1.14.0-hb453b48_1 hdf4 conda-forge/linux-64::hdf4-4.2.13-h9a582f1_1002 hdf5 conda-forge/linux-64::hdf5-1.10.4-nompi_h11e915b_1105 icu conda-forge/linux-64::icu-58.2-hf484d3e_1000 intel-openmp pkgs/main/linux-64::intel-openmp-2019.1-144 jpeg conda-forge/linux-64::jpeg-9c-h14c3975_1001 json-c conda-forge/linux-64::json-c-0.13.1-h14c3975_1001 kealib conda-forge/linux-64::kealib-1.4.10-he7154bc_1002 kiwisolver conda-forge/linux-64::kiwisolver-1.0.1-py37h6bb024c_1002 krb5 conda-forge/linux-64::krb5-1.16.3-h05b26f9_1001 libcurl conda-forge/linux-64::libcurl-7.64.0-h541490c_2 libdap4 conda-forge/linux-64::libdap4-3.19.1-0 libedit conda-forge/linux-64::libedit-3.1.20170329-hf8c457e_1001 libffi conda-forge/linux-64::libffi-3.2.1-hf484d3e_1005 libgcc-ng conda-forge/linux-64::libgcc-ng-7.3.0-hdf63c60_0 libgdal pkgs/main/linux-64::libgdal-2.3.3-h2e7e64b_0 libgfortran-ng conda-forge/linux-64::libgfortran-ng-7.2.0-hdf63c60_3 libiconv conda-forge/linux-64::libiconv-1.15-h14c3975_1004 libkml conda-forge/linux-64::libkml-1.3.0-h328b03d_1009 libnetcdf conda-forge/linux-64::libnetcdf-4.6.2-hbdf4f91_1001 libpng conda-forge/linux-64::libpng-1.6.36-h84994c4_1000 libpq pkgs/main/linux-64::libpq-11.1-h20c2e04_0 libspatialindex conda-forge/linux-64::libspatialindex-1.8.5-hf484d3e_1003 libspatialite conda-forge/linux-64::libspatialite-4.3.0a-hb5ec416_1026 libssh2 conda-forge/linux-64::libssh2-1.8.0-h90d6eec_1004 libstdcxx-ng conda-forge/linux-64::libstdcxx-ng-7.3.0-hdf63c60_0 libtiff conda-forge/linux-64::libtiff-4.0.10-h648cc4a_1001 libuuid conda-forge/linux-64::libuuid-1.0.3-1 libxcb conda-forge/linux-64::libxcb-1.13-h14c3975_1002 libxml2 conda-forge/linux-64::libxml2-2.9.8-h143f9aa_1005 matplotlib conda-forge/linux-64::matplotlib-3.0.3-py37_0 matplotlib-base conda-forge/linux-64::matplotlib-base-3.0.3-py37h167e16e_0 mkl pkgs/main/linux-64::mkl-2019.1-144 mkl_fft conda-forge/linux-64::mkl_fft-1.0.10-py37h14c3975_1 mkl_random conda-forge/linux-64::mkl_random-1.0.2-py37h637b7d7_2 munch conda-forge/noarch::munch-2.3.2-py_0 ncurses conda-forge/linux-64::ncurses-6.1-hf484d3e_1002 numpy pkgs/main/linux-64::numpy-1.15.4-py37h7e9f1db_0 numpy-base pkgs/main/linux-64::numpy-base-1.15.4-py37hde5b4d6_0 openjpeg conda-forge/linux-64::openjpeg-2.3.0-hf38bd82_1003 openssl conda-forge/linux-64::openssl-1.1.1b-h14c3975_0 palettable conda-forge/noarch::palettable-3.1.1-py_0 pandas conda-forge/linux-64::pandas-0.24.1-py37hf484d3e_0 patsy conda-forge/noarch::patsy-0.5.1-py_0 pcre pkgs/main/linux-64::pcre-8.42-h439df22_0 pip conda-forge/linux-64::pip-19.0.3-py37_0 pixman conda-forge/linux-64::pixman-0.34.0-h14c3975_1003 poppler conda-forge/linux-64::poppler-0.72.0-h2fc8fa2_1000 poppler-data conda-forge/noarch::poppler-data-0.4.9-1 proj4 conda-forge/linux-64::proj4-5.2.0-h14c3975_1001 psycopg2 pkgs/main/linux-64::psycopg2-2.7.6.1-py37h1ba5d50_0 pthread-stubs conda-forge/linux-64::pthread-stubs-0.4-h14c3975_1001 pyparsing conda-forge/noarch::pyparsing-2.3.1-py_0 pyproj conda-forge/linux-64::pyproj-1.9.6-py37hc0953d3_1000 pyqt conda-forge/linux-64::pyqt-5.6.0-py37h13b7fb3_1008 pysal conda-forge/noarch::pysal-2.0.0-py_0 python conda-forge/linux-64::python-3.7.1-h381d211_1002 python-dateutil conda-forge/noarch::python-dateutil-2.8.0-py_0 pytz conda-forge/noarch::pytz-2018.9-py_0 qt pkgs/main/linux-64::qt-5.6.3-h8bf5577_3 readline conda-forge/linux-64::readline-7.0-hf8c457e_1001 rtree conda-forge/linux-64::rtree-0.8.3-py37_1000 scipy pkgs/main/linux-64::scipy-1.2.1-py37h7c811a0_0 seaborn conda-forge/noarch::seaborn-0.9.0-py_0 setuptools conda-forge/linux-64::setuptools-40.8.0-py37_0 shapely conda-forge/linux-64::shapely-1.6.4-py37h092830f_1002 sip conda-forge/linux-64::sip-4.18.1-py37hf484d3e_1000 six conda-forge/linux-64::six-1.12.0-py37_1000 sqlalchemy conda-forge/linux-64::sqlalchemy-1.2.18-py37h14c3975_0 sqlite conda-forge/linux-64::sqlite-3.26.0-h67949de_1000 statsmodels conda-forge/linux-64::statsmodels-0.9.0-py37h3010b51_1000 tk conda-forge/linux-64::tk-8.6.9-h84994c4_1000 tornado conda-forge/linux-64::tornado-5.1.1-py37h14c3975_1000 util-linux pkgs/free/linux-64::util-linux-2.21-0 wheel conda-forge/linux-64::wheel-0.33.1-py37_0 xerces-c conda-forge/linux-64::xerces-c-3.2.2-hac72e42_1001 xorg-libxau conda-forge/linux-64::xorg-libxau-1.0.9-h14c3975_0 xorg-libxdmcp conda-forge/linux-64::xorg-libxdmcp-1.1.2-h14c3975_1007 xz conda-forge/linux-64::xz-5.2.4-h14c3975_1001 zlib conda-forge/linux-64::zlib-1.2.11-h14c3975_1004 Proceed ([y]/n)? y Downloading and Extracting Packages libedit-3.1.20170329 | 172 KB | ########################################################################## | 100% fiona-1.8.4 | 1.0 MB | ########################################################################## | 100% libdap4-3.19.1 | 15.6 MB | ########################################################################## | 100% psycopg2-2.7.6.1 | 308 KB | ########################################################################## | 100% libgdal-2.3.3 | 17.7 MB | ########################################################################## | 100% curl-7.64.0 | 143 KB | ########################################################################## | 100% krb5-1.16.3 | 1.4 MB | ########################################################################## | 100% libcurl-7.64.0 | 573 KB | ########################################################################## | 100% dbus-1.13.6 | 587 KB | ########################################################################## | 100% gdal-2.3.3 | 1.3 MB | ########################################################################## | 100% pthread-stubs-0.4 | 5 KB | ########################################################################## | 100% util-linux-2.21 | 35 KB | ########################################################################## | 100% libssh2-1.8.0 | 245 KB | ########################################################################## | 100% blas-1.0 | 6 KB | ########################################################################## | 100% numpy-1.15.4 | 47 KB | ########################################################################## | 100% poppler-0.72.0 | 12.1 MB | ########################################################################## | 100% matplotlib-3.0.3 | 6 KB | ########################################################################## | 100% libuuid-1.0.3 | 34 KB | ########################################################################## | 100% libpq-11.1 | 2.6 MB | ########################################################################## | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate TEST # # To deactivate an active environment, use # # $ conda deactivate @:~$ conda activate TEST (TEST) @:~$ python Python 3.7.1 | packaged by conda-forge | (default, Feb 26 2019, 04:48:14) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import geopandas Traceback (most recent call last): File "", line 1, in File "/home//anaconda3/envs/TEST/lib/python3.7/site-packages/geopandas/__init__.py", line 4, in from geopandas.io.file import read_file File "/home//anaconda3/envs/TEST/lib/python3.7/site-packages/geopandas/io/file.py", line 3, in import fiona File "/home//anaconda3/envs/TEST/lib/python3.7/site-packages/fiona/__init__.py", line 83, in from fiona.collection import BytesCollection, Collection File "/home//anaconda3/envs/TEST/lib/python3.7/site-packages/fiona/collection.py", line 9, in from fiona.ogrext import Iterator, ItemsIterator, KeysIterator ImportError: libpoppler.so.76: cannot open shared object file: No such file or directory >>> ```
ocefpaf commented 5 years ago

It is a classic error of mixing channels as described here.

josemarfdc commented 5 years ago

Thanks @ocefpaf!

For other people coming here with the same issue, notice when creating the environment I added the channel with -c conda create --yes --name TEST python=3.7 geopandas --channel conda-forge

That still does not force conda to get the dependencies only from conda-forge. Removing --defaults from .condarc also has no effect. You need to add channel_priority: strict to .condarc, then it will get it right.

ocefpaf commented 5 years ago

You need to add channel_priority: strict to .condarc, then it will get it right.

It is important to note that the channel_priority: strict option is new and you'll need an updated conda (>=4.6.1 if I'm not mistaken).