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

ImportError: libicui18n.so.56 and/or libicui18n.so.58 when importing fiona (geopandas) #21

Closed
plelong opened this issue Mar 21, 2017 · 12 comments

Comments

@plelong
Copy link

plelong commented Mar 21, 2017

Hi,
I'm using anaconda on Ubuntu 16.04 (xenial Xerus) on EC2.
After installing anaconda I install geopandas with:
conda install geopandas --channel conda-forge
That works great but I then go to a jupyter notebook and try to import geopandas but get :

`ImportError                               Traceback (most recent call last)
<ipython-input-1-c9ee6bd24dbc> in <module>()
----> 1 import geopandas

/home/ubuntu/anaconda3/lib/python3.6/site-packages/geopandas/__init__.py in <module>()
      2 from geopandas.geodataframe import GeoDataFrame
      3 
----> 4 from geopandas.io.file import read_file
      5 from geopandas.io.sql import read_postgis
      6 from geopandas.tools import sjoin

/home/ubuntu/anaconda3/lib/python3.6/site-packages/geopandas/io/file.py in <module>()
      1 import os
      2 
----> 3 import fiona
      4 import numpy as np
      5 from shapely.geometry import mapping

/home/ubuntu/anaconda3/lib/python3.6/site-packages/fiona/__init__.py in <module>()
     67 from six import string_types
     68 
---> 69 from fiona.collection import Collection, BytesCollection, vsi_path
     70 from fiona._drivers import driver_count, GDALEnv
     71 from fiona.drvsupport import supported_drivers

/home/ubuntu/anaconda3/lib/python3.6/site-packages/fiona/collection.py in <module>()
      7 
      8 from fiona import compat
----> 9 from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
     10 from fiona.ogrext import Session, WritingSession
     11 from fiona.ogrext import (

ImportError: libicui18n.so.56: cannot open shared object file: No such file or directory`

This has to do with the fiona package that requires libicui18n.so.56. When I type
conda search icu --channel conda-forge
I do get that it is the 54 version which is installed (with a *) and I therefore use
conda install icu=56.1 --channel conda-forge
and that installs a entire set of packages (and downgrade python from 3.6 and 3.5) when this is done, my import error gives me:
ImportError: libicui18n.so.58: cannot open shared object file: No such file or directory
It seems like fiona is requiring both 56 and 58 version of icu. When I switch to 58 then 56 is missing ...
Do you have any idea of what is going wrong there and what I could do to fix this?
Thanks,

@ocefpaf
Copy link
Member

ocefpaf commented Mar 21, 2017

It looks like you have the usual "multiple channes" problem. Please take a look at http://conda-forge.github.io/docs/conda-forge_gotchas.html#using-multiple-channels and let us know if that fixes it for you. (Closing this for now but feel free to ask further questions here in case you are in doubt.)

@ocefpaf ocefpaf closed this as completed Mar 21, 2017
@plelong
Copy link
Author

plelong commented Mar 22, 2017

I tried to fix it using
conda config --add channels new_channel before running conda install geopandas
and I do get
cat .condarc
channels:
- conda-forge
- defaults
But when importing geopandas in a jupyter notebook I still get an error on fiona:
ImportError: libicui18n.so.56: cannot open shared object file: No such file or directory

Do you any other idea of what that might be ? let me know if you need some more info on my system

@plelong
Copy link
Author

plelong commented Mar 22, 2017

Update: creating a new conda env seems to solve the issue. I will let you know if this is not the case.

@pkmn99
Copy link

pkmn99 commented Apr 17, 2017

I have exact the same problem. Creating a new environment works, but i really hope there could be a fix without creating a new env. The new environment takes a lot space (2GB) ...

@ocefpaf
Copy link
Member

ocefpaf commented Apr 18, 2017

The new environment takes a lot space (2GB)

There is no way around it because those extra packages are the ones you need to be compatible with the package you are requesting from conda-forge. That is why I recommend people to use miniconda and create envs. Miniconda is lightweight and won't bring any extra package that will be replaced by conda-forge later, unlike the anaconda distro which will be probably 99% replaced. And then, with envs, you will get symlinks to the packages you download avoiding the space waste when creating multiple envs.

@pkmn99
Copy link

pkmn99 commented Apr 18, 2017

Yes, I am using anaconda. The duplicated packages in Anaconda indeed take my disk space. Glad to know these features of miniconda. Thanks ocefpaf!

@ivanhigueram
Copy link

Hello,
Thanks for sharing how you solved the issue. I am right now having the same problem installing and calling geopandas. I have create a new virtual environment using: conda create -n env python=3.5 anaconda. Nonetheless, the ImportError persists. There is another road to take to solve this problem?

@ocefpaf
Copy link
Member

ocefpaf commented Jun 21, 2017

Nonetheless, the ImportError persists. There is another road to take to solve this problem?

It should, you installed the whole anaconda distro there 😄

Please read http://conda-forge.github.io/docs/conda-forge_gotchas.html#using-multiple-channels with care and note that the reason for isolating into envs and preferring the conda-forge channels when using conda-forge packages is to avoid conflicts with the anaconda distribution.

@kyle-sama
Copy link

So I read the multiple channels link.
I have the two channels:
channels:

  • conda-forge
  • defaults
    I created a new environment
    conda create -n env whatever
    install my libraries
    conda install geopandas, ipykernel, basemap

and I still get the error. What the heck am I doing wrong?

@ocefpaf
Copy link
Member

ocefpaf commented Sep 8, 2017

@kyle-sama seems like you did everything right 😕

Can you send the results of conda info and conda list for tht env?

@clementlefevre
Copy link

Hi,
Similar problem :

Fiona==1.7.9
geopandas==0.3.0

Using a python 3.5 env and install geopandas using conda install geopandas, i can import the ´geopandas´ package from the python console but not from ipython/jupyter notebook.

/home/ramon/anaconda2/lib/python2.7/site-packages/fiona/collection.py in <module>()
      7 
      8 from fiona import compat
----> 9 from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
     10 from fiona.ogrext import Session, WritingSession
     11 from fiona.ogrext import (

ImportError: libicui18n.so.56: cannot open shared object file: No such file or directory

conda info:
(env) ramon@ramon-ThinkPad-X220:~$ conda info
Current conda install:

               platform : linux-64
          conda version : 4.3.29
       conda is private : False
      conda-env version : 4.3.29
    conda-build version : 2.0.2
         python version : 2.7.12.final.0
       requests version : 2.18.4
       root environment : /home/ramon/anaconda2  (writable)
    default environment : /home/ramon/anaconda2/envs/env
       envs directories : /home/ramon/anaconda2/envs
                          /home/ramon/.conda/envs
          package cache : /home/ramon/anaconda2/pkgs
                          /home/ramon/.conda/pkgs
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : /home/ramon/.condarc
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.29 requests/2.18.4 CPython/2.7.12 Linux/4.4.0-98-generic debian/stretch/sid glibc/2.23    
                UID:GID : 1000:1000
´

@ocefpaf
Copy link
Member

ocefpaf commented Nov 20, 2017

I am locking this thread b/c people keep finding it with Google but they are not really reading everything in here. First I recommend to go to conda-forge's docs to understand the issue. https://conda-forge.org/docs/conda-forge_gotchas.html

Then try what is recommended in the docs:

conda create --yes --name TEST geopandas
source activate TEST
python -c "import geopandas; print(geopandas.__version__)"

that proves the package works in the right conditions. Any other third party channel mixing and/or pre-installed packages in an env, like the Anaconda distribution, is not guaranteed to work!

@conda-forge conda-forge locked and limited conversation to collaborators Nov 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants