Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rasterio fails on import - libgdal.20.dylib Reason: image not found #118

Closed
lwasser opened this issue Mar 15, 2019 · 7 comments
Closed

Rasterio fails on import - libgdal.20.dylib Reason: image not found #118

lwasser opened this issue Mar 15, 2019 · 7 comments

Comments

@lwasser
Copy link
Member

lwasser commented Mar 15, 2019

Issue:
Installing rasterio works but it fails on import.

I've tried:
conda create --yes -n just_rio py>3.6 && conda activate just_rio && conda install -c conda-forge rasterio

Then i try to import rasterio and get

>>> import rasterio
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda3/envs/earth-analytics-python/lib/python3.7/site-packages/rasterio/__init__.py", line 22, in <module>
    from rasterio._base import gdal_version
ImportError: dlopen(/anaconda3/envs/earth-analytics-python/lib/python3.7/site-packages/rasterio/_base.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libgif.7.dylib
  Referenced from: /anaconda3/envs/earth-analytics-python/lib/libgdal.20.dylib
  Reason: image not found

I also noticed that the builds seem to be failing on circle-ci.


Environment (conda list):
I have tried in my usual environment but also please see above. i tried to JUST Install rasterio via conda and it still failed.

$ conda list
# packages in environment at /anaconda3/envs/just_rio:
#
# Name                    Version                   Build  Channel
affine                    2.2.2                      py_0    conda-forge
asn1crypto                0.24.0                py37_1003    conda-forge
attrs                     19.1.0                     py_0    conda-forge
blas                      2.1                    openblas    conda-forge
boost-cpp                 1.68.0            h6f8c590_1000    conda-forge
boto3                     1.9.115                    py_0    conda-forge
botocore                  1.12.115                   py_0    conda-forge
bzip2                     1.0.6             h1de35cc_1002    conda-forge
ca-certificates           2019.3.9             hecc5488_0    conda-forge
cairo                     1.16.0            h9247486_1000    conda-forge
certifi                   2019.3.9                 py37_0    conda-forge
cffi                      1.12.2           py37h2d6ddff_1    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
cryptography              2.6.1            py37hc2b1221_0    conda-forge
curl                      7.64.0               ha441bb4_2  
docutils                  0.14                  py37_1001    conda-forge
expat                     2.2.5             h0a44026_1002    conda-forge
fontconfig                2.13.1            h1027ab8_1000    conda-forge
freetype                  2.9.1             h597ad8a_1005    conda-forge
freexl                    1.0.5             h1de35cc_1002    conda-forge
geos                      3.7.1             h0a44026_1000    conda-forge
geotiff                   1.4.3             hce09ea4_1000    conda-forge
gettext                   0.19.8.1          hcca000d_1001    conda-forge
giflib                    5.1.7                h01d97ff_0    conda-forge
glib                      2.58.3            h2836805_1001    conda-forge
hdf4                      4.2.13            hf3c6af0_1002    conda-forge
hdf5                      1.10.4          nompi_h646315f_1105    conda-forge
icu                       58.2              h0a44026_1000    conda-forge
idna                      2.8                   py37_1000    conda-forge
jmespath                  0.9.4                      py_0    conda-forge
jpeg                      9c                h1de35cc_1001    conda-forge
json-c                    0.13.1            h1de35cc_1001    conda-forge
kealib                    1.4.10            hf5ed860_1002    conda-forge
krb5                      1.16.1               hddcf347_7  
libblas                   3.8.0                1_openblas    conda-forge
libcblas                  3.8.0                1_openblas    conda-forge
libcurl                   7.64.0               h051b688_2  
libcxx                    4.0.1                hcfea43d_1  
libcxxabi                 4.0.1                hcfea43d_1  
libdap4                   3.19.1            hae55d67_1000    conda-forge
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.2.1                h475c297_4  
libgdal                   2.4.0             h947adae_1003    conda-forge
libgfortran               3.0.1                         0    conda-forge
libiconv                  1.15              h1de35cc_1004    conda-forge
libkml                    1.3.0             h71ee1b2_1009    conda-forge
liblapack                 3.8.0                1_openblas    conda-forge
liblapacke                3.8.0                1_openblas    conda-forge
libnetcdf                 4.6.2             h6b88ef6_1001    conda-forge
libopenblas               0.3.3                hdc02c5d_3  
libpng                    1.6.36            ha441bb4_1000    conda-forge
libpq                     11.2                 h051b688_0  
libspatialite             4.3.0a            h0cd9627_1026    conda-forge
libssh2                   1.8.0             hb1dc21d_1004    conda-forge
libtiff                   4.0.10            h79f4b77_1001    conda-forge
libxml2                   2.9.8             hf14e9c8_1005    conda-forge
ncurses                   6.1                  h0a44026_1  
numpy                     1.16.2           py37h926163e_0  
numpy-base                1.16.2           py37ha711998_0  
openblas                  0.3.5             h436c29b_1001    conda-forge
openjpeg                  2.3.0             h3bf0609_1003    conda-forge
openssl                   1.1.1b               h1de35cc_1    conda-forge
pcre                      8.41              h0a44026_1003    conda-forge
pip                       19.0.3                   py37_0  
pixman                    0.34.0            h1de35cc_1003    conda-forge
poppler                   0.67.0               hb974355_6    conda-forge
poppler-data              0.4.9                         1    conda-forge
postgresql                11.2                 h051b688_0  
proj4                     5.2.0             h1de35cc_1001    conda-forge
py                        1.8.0                    py37_0  
pycparser                 2.19                     py37_1    conda-forge
pyopenssl                 19.0.0                   py37_0    conda-forge
pyparsing                 2.3.1                      py_0    conda-forge
pysocks                   1.6.8                 py37_1002    conda-forge
python                    3.7.2                haf84260_0  
python-dateutil           2.8.0                      py_0    conda-forge
rasterio                  1.0.18           py37h3683dd5_0    conda-forge
readline                  7.0                  h1de35cc_5  
s3transfer                0.2.0                    py37_0    conda-forge
setuptools                40.8.0                   py37_0  
six                       1.12.0                py37_1000    conda-forge
snuggs                    1.4.3                      py_0    conda-forge
sqlite                    3.27.2               ha441bb4_0  
tk                        8.6.8                ha441bb4_0  
urllib3                   1.24.1                py37_1000    conda-forge
wheel                     0.33.1                   py37_0  
xerces-c                  3.2.2             h44e365a_1001    conda-forge
xz                        5.2.4                h1de35cc_4  
zlib                      1.2.11               h1de35cc_3  

Details about conda and system ( conda info ):
$ conda info
active environment : just_rio
    active env location : /anaconda3/envs/just_rio
            shell level : 2
       user config file : /Users/leahwasser/.condarc
 populated config files : 
          conda version : 4.5.12
    conda-build version : 3.17.6
         python version : 3.7.1.final.0
       base environment : /anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/osx-64
                          https://repo.anaconda.com/pkgs/pro/noarch
          package cache : /anaconda3/pkgs
                          /Users/leahwasser/.conda/pkgs
       envs directories : /anaconda3/envs
                          /Users/leahwasser/.conda/envs
               platform : osx-64
             user-agent : conda/4.5.12 requests/2.21.0 CPython/3.7.1 Darwin/18.2.0 OSX/10.14.3
                UID:GID : 502:20
             netrc file : None
           offline mode : False
@ocefpaf I've tried to install rasterio several times today and it seems to be failing via libgdal. i've tried installing older versions as well. Is there an issue on conda-forge today by chance? many thanks for your assistance.

pinging my colleague @mbjoseph as well on this.

@lwasser lwasser changed the title Rasterio fails on import Rasterio fails on import - libgdal.20.dylib Reason: image not found Mar 15, 2019
@ocefpaf
Copy link
Member

ocefpaf commented Mar 15, 2019

@lwasser it is a channel mixing problem. Can you do:

  • conda update conda # to ensure you have conda >=4.6
  • conda config --add channels conda-forge # to add conda-forge to the channel list
  • conda config --set channel_priority strict # enable the strict channel feature

Then you can try:

conda create --yes --name RIO python=3.7 rasterio
conda activate RIO
rio --help

@lwasser
Copy link
Member Author

lwasser commented Mar 16, 2019

hey @ocefpaf . Thank you. i tried the above and am still getting the same issue

conda info and conda list results below

(RIO) cu-biot-16-10:~ leahwasser$ conda info

     active environment : RIO
    active env location : /anaconda3/envs/RIO
            shell level : 2
       user config file : /Users/leahwasser/.condarc
 populated config files : /Users/leahwasser/.condarc
          conda version : 4.6.8
    conda-build version : 3.17.6
         python version : 3.7.1.final.0
       base environment : /anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /anaconda3/pkgs
                          /Users/leahwasser/.conda/pkgs
       envs directories : /anaconda3/envs
                          /Users/leahwasser/.conda/envs
               platform : osx-64
             user-agent : conda/4.6.8 requests/2.21.0 CPython/3.7.1 Darwin/18.2.0 OSX/10.14.3
                UID:GID : 502:20
             netrc file : None
           offline mode : False

conda list

# packages in environment at /anaconda3/envs/RIO:
#
# Name                    Version                   Build  Channel
affine                    2.2.2                      py_0    conda-forge
attrs                     19.1.0                     py_0    conda-forge
blas                      1.1                    openblas    conda-forge
boost-cpp                 1.68.0            h6f8c590_1000    conda-forge
bzip2                     1.0.6             h1de35cc_1002    conda-forge
ca-certificates           2019.3.9             hecc5488_0    conda-forge
cairo                     1.16.0            h9247486_1000    conda-forge
certifi                   2019.3.9                 py37_0    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               heae2a1f_2    conda-forge
expat                     2.2.5             h0a44026_1002    conda-forge
fontconfig                2.13.1            h1027ab8_1000    conda-forge
freetype                  2.10.0               h24853df_0    conda-forge
freexl                    1.0.5             h1de35cc_1002    conda-forge
geos                      3.7.1             h0a44026_1000    conda-forge
geotiff                   1.4.3             hce09ea4_1000    conda-forge
gettext                   0.19.8.1          hcca000d_1001    conda-forge
giflib                    5.1.7                h01d97ff_0    conda-forge
glib                      2.58.3            h2836805_1001    conda-forge
hdf4                      4.2.13            hf3c6af0_1002    conda-forge
hdf5                      1.10.4          nompi_h646315f_1105    conda-forge
icu                       58.2              h0a44026_1000    conda-forge
jpeg                      9c                h1de35cc_1001    conda-forge
json-c                    0.13.1            h1de35cc_1001    conda-forge
kealib                    1.4.10            hf5ed860_1002    conda-forge
krb5                      1.16.3            hcfa6398_1001    conda-forge
libcurl                   7.64.0               he376013_2    conda-forge
libcxx                    7.0.0                h2d50403_1    conda-forge
libdap4                   3.19.1            hae55d67_1000    conda-forge
libedit                   3.1.20170329      hcfe32e1_1001    conda-forge
libffi                    3.2.1             h0a44026_1005    conda-forge
libgdal                   2.4.0             h947adae_1003    conda-forge
libgfortran               3.0.1                         0    conda-forge
libiconv                  1.15              h1de35cc_1004    conda-forge
libkml                    1.3.0             h71ee1b2_1009    conda-forge
libnetcdf                 4.6.2             h6b88ef6_1001    conda-forge
libpng                    1.6.36            ha441bb4_1000    conda-forge
libpq                     11.2                 h29c6f28_0    conda-forge
libspatialite             4.3.0a            h0cd9627_1026    conda-forge
libssh2                   1.8.0             hb1dc21d_1004    conda-forge
libtiff                   4.0.10            h344961e_1002    conda-forge
libxml2                   2.9.8             hf14e9c8_1005    conda-forge
llvm-meta                 7.0.0                         0    conda-forge
ncurses                   6.1               h0a44026_1002    conda-forge
numpy                     1.16.2          py37_blas_openblash486cb9f_0  [blas_openblas]  conda-forge
openblas                  0.3.3             hdc02c5d_1001    conda-forge
openjpeg                  2.3.0             h3bf0609_1003    conda-forge
openssl                   1.1.1b               h1de35cc_1    conda-forge
pcre                      8.41              h0a44026_1003    conda-forge
pip                       19.0.3                   py37_0    conda-forge
pixman                    0.34.0            h1de35cc_1003    conda-forge
poppler                   0.67.0               hb974355_6    conda-forge
poppler-data              0.4.9                         1    conda-forge
postgresql                11.2                 h16efa30_0    conda-forge
proj4                     5.2.0             h1de35cc_1001    conda-forge
pyparsing                 2.3.1                      py_0    conda-forge
python                    3.7.1             hbdd33cc_1003    conda-forge
rasterio                  1.0.21           py37h437083a_1    conda-forge
readline                  7.0               hcfe32e1_1001    conda-forge
setuptools                40.8.0                   py37_0    conda-forge
snuggs                    1.4.3                      py_0    conda-forge
sqlite                    3.26.0            h1765d9f_1001    conda-forge
tk                        8.6.9             ha441bb4_1000    conda-forge
tzcode                    2018g             h1de35cc_1001    conda-forge
wheel                     0.33.1                   py37_0    conda-forge
xerces-c                  3.2.2             h44e365a_1001    conda-forge
xz                        5.2.4             h1de35cc_1001    conda-forge
zlib                      1.2.11            h1de35cc_1004    conda-forge
zstd                      1.3.3                         1    conda-forge

rio --help

(RIO) cu-biot-16-10:~ leahwasser$ rio --help
Traceback (most recent call last):
  File "/anaconda3/envs/RIO/bin/rio", line 7, in <module>
    from rasterio.rio.main import main_group
  File "/anaconda3/envs/RIO/lib/python3.7/site-packages/rasterio/__init__.py", line 22, in <module>
    from rasterio._base import gdal_version
ImportError: dlopen(/anaconda3/envs/RIO/lib/python3.7/site-packages/rasterio/_base.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libgif.7.dylib
  Referenced from: /anaconda3/envs/RIO/lib/libgdal.20.dylib
  Reason: image not found

I am happy to try something else!

@mbjoseph
Copy link
Member

Not sure whether this is relevant, but the CircleCI OS X build fails with the same error Library not loaded: @rpath/libgif.7.dylib upon importing rasterio: https://circleci.com/gh/conda-forge/rasterio-feedstock/709?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

@ocefpaf
Copy link
Member

ocefpaf commented Mar 17, 2019

We are experiencing an issue of mixed packages from different channels in our own CIs. Trying to fix it. For now you can rely on only defaults for the GIS stack. That won't give you the latest packages available on conda-forge but will deliver a stable environment. I'll report back here as soon as the problem is fixed.

@ocefpaf
Copy link
Member

ocefpaf commented Mar 18, 2019

@mbjoseph and @lwasser if you can test this again today please let me know how it goes. The new packages with the giflib fixes should be landing in the channel now.

@lwasser
Copy link
Member Author

lwasser commented Mar 18, 2019

@ocefpaf i just tested it and it seemed to work. I'm going to rebuild my envts now and will followup with an update. but as far as I can see so far, things are working now. THANK YOU for your work on this.

@ocefpaf
Copy link
Member

ocefpaf commented Mar 18, 2019

Glad it is working. Closing this, please re-open if you are still experiencing problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants