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

Failing on binder with libjson error #76

Closed
jorisvandenbossche opened this issue May 17, 2018 · 16 comments
Closed

Failing on binder with libjson error #76

jorisvandenbossche opened this issue May 17, 2018 · 16 comments

Comments

@jorisvandenbossche
Copy link
Member

(don't know in which feedstock to best open it)

From geopandas/geopandas#727 (comment)

Importing fiona is failing with ImportError: libjson-c.so.2: cannot open shared object file: No such file or directory in a simple binder environment: https://github.com/aborruso/geopandashub

(when it was failing it was: https://github.com/aborruso/geopandashub/blob/1f746abd31f29e0e0554dc42e5da16f6cd7bc85a/binder/environment.yml, now defaults was added)

@ocefpaf
Copy link
Member

ocefpaf commented May 17, 2018

I pulled the new json-c and things should be OK for now. Thanks @jorisvandenbossche!

@ocefpaf ocefpaf closed this as completed May 17, 2018
@yaph
Copy link

yaph commented May 24, 2018

For people who still get this error, here is a workaround that worked for me. In the lib directory of your conda environment add a symbolic link for the missing file, like so:

 ln -s libjson-c.so.4.0.0 libjson-c.so.2

@ocefpaf
Copy link
Member

ocefpaf commented May 24, 2018

For people who still get this error, here is a workaround that worked for me. In the lib directory of your conda environment add a symbolic link for the missing file, like so:
ln -s libjson-c.so.4.0.0 libjson-c.so.2

Do not do that. The ABI change and this will crash badly. This issue was solved as I said in #76 (comment)

All you need to do is to update or recreate your envs.

@yaph
Copy link

yaph commented May 24, 2018

Sorry, I didn't know about these side effects, but removing and re-installing fiona did not solve the problem for me. I haven't tried to completely re-create the environment though.

@ocefpaf
Copy link
Member

ocefpaf commented May 24, 2018

but removing and re-installing fiona did not solve the problem for me.

The new json-c was probably cached. Can you do a conda clean --yes --all and try that again?

@yaph
Copy link

yaph commented May 24, 2018

I just did the following after removing the symbolic link I created previously:

conda uninstall fiona
conda clean --yes --all
conda install fiona

Now when I try to import fiona, I get the error about the missing libjson-c.so.2 again. The fiona version that was installed is 1.7.11-py36_3.

@ocefpaf
Copy link
Member

ocefpaf commented May 24, 2018

Let's try a fresh env:

conda create --name TEST python=3.6 fiona
conda activate TEST
> python -c "import fiona; print(fiona.__version__)"                                              
1.7.11

Here are the results of my conda list:

> conda list
# packages in environment at /home/filipe/miniconda3/envs/TEST:
#
# Name                    Version                   Build  Channel
backcall                  0.1.0                      py_0    conda-forge
bleach                    2.1.3                      py_0    conda-forge
boost                     1.66.0                   py36_1    conda-forge
boost-cpp                 1.66.0                        1    conda-forge
bzip2                     1.0.6                         1    conda-forge
ca-certificates           2018.4.16                     0    conda-forge
cairo                     1.14.10                       0    conda-forge
certifi                   2018.4.16                py36_0    conda-forge
click                     6.7                        py_1    conda-forge
click-plugins             1.0.3                    py36_0    conda-forge
cligj                     0.4.0                    py36_0    conda-forge
curl                      7.60.0                        0    conda-forge
dbus                      1.11.0                        0    conda-forge
decorator                 4.3.0                      py_0    conda-forge
entrypoints               0.2.3                    py36_1    conda-forge
expat                     2.2.5                         0    conda-forge
fiona                     1.7.11                   py36_3    conda-forge
fontconfig                2.12.6                        0    conda-forge
freetype                  2.8.1                         0    conda-forge
freexl                    1.0.5                         0    conda-forge
gdal                      2.2.4                    py36_0    conda-forge
geos                      3.6.2                         1    conda-forge
geotiff                   1.4.2                         1    conda-forge
gettext                   0.19.8.1                      0    conda-forge
giflib                    5.1.4                         0    conda-forge
glib                      2.55.0                        0    conda-forge
gmp                       6.1.2                         0    conda-forge
gst-plugins-base          1.8.0                         0    conda-forge
gstreamer                 1.8.0                         1    conda-forge
hdf4                      4.2.13                        0    conda-forge
hdf5                      1.10.1                        2    conda-forge
html5lib                  1.0.1                      py_0    conda-forge
icu                       58.2                          0    conda-forge
ipykernel                 4.8.2                    py36_0    conda-forge
ipython                   6.4.0                    py36_0    conda-forge
ipython_genutils          0.2.0                    py36_0    conda-forge
ipywidgets                7.2.1                    py36_1    conda-forge
jedi                      0.12.0                   py36_0    conda-forge
jinja2                    2.10                     py36_0    conda-forge
jpeg                      9b                            2    conda-forge
json-c                    0.12.1                        0    conda-forge
jsonschema                2.6.0                    py36_1    conda-forge
jupyter                   1.0.0                      py_1    conda-forge
jupyter_client            5.2.3                    py36_0    conda-forge
jupyter_console           5.2.0                    py36_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
kealib                    1.4.7                         4    conda-forge
krb5                      1.14.6                        0    conda-forge
libdap4                   3.18.3                        2    conda-forge
libffi                    3.2.1                         3    conda-forge
libgcc                    7.2.0                h69d50b8_2    defaults
libgcc-ng                 7.2.0                hdf63c60_3    defaults
libgdal                   2.2.4                         2    conda-forge
libgfortran               3.0.0                         1    defaults
libgfortran-ng            7.2.0                hdf63c60_3    defaults
libiconv                  1.15                          0    conda-forge
libkml                    1.3.0                         6    conda-forge
libnetcdf                 4.6.1                         2    conda-forge
libopenblas               0.2.20               h9ac9557_4    defaults
libpng                    1.6.34                        0    conda-forge
libpq                     9.6.3                         0    conda-forge
libsodium                 1.0.16                        0    conda-forge
libspatialite             4.3.0a                       19    conda-forge
libssh2                   1.8.0                         2    conda-forge
libstdcxx-ng              7.2.0                hdf63c60_3    defaults
libtiff                   4.0.9                         0    conda-forge
libxcb                    1.13                          0    conda-forge
libxml2                   2.9.8                         0    conda-forge
markupsafe                1.0                      py36_0    conda-forge
mistune                   0.8.3                    py36_1    conda-forge
munch                     2.3.2                      py_0    conda-forge
nbconvert                 5.3.1                      py_1    conda-forge
nbformat                  4.4.0                    py36_0    conda-forge
ncurses                   5.9                          10    conda-forge
notebook                  5.5.0                    py36_0    conda-forge
numpy                     1.14.3           py36h28100ab_1    defaults
numpy-base                1.14.3           py36h0ea5e3f_1    defaults
openjpeg                  2.3.0                         2    conda-forge
openssl                   1.0.2o                        0    conda-forge
pandoc                    2.2.1                         0    conda-forge
pandocfilters             1.4.2                    py36_0    conda-forge
parso                     0.2.1                      py_0    conda-forge
pcre                      8.41                          1    conda-forge
pexpect                   4.5.0                    py36_0    conda-forge
pickleshare               0.7.4                    py36_0    conda-forge
pip                       9.0.3                    py36_0    conda-forge
pixman                    0.34.0                        2    conda-forge
poppler                   0.61.1                        3    conda-forge
poppler-data              0.4.9                         0    conda-forge
proj4                     4.9.3                         5    conda-forge
prompt_toolkit            1.0.15                   py36_0    conda-forge
ptyprocess                0.5.2                    py36_0    conda-forge
pygments                  2.2.0                    py36_0    conda-forge
pyqt                      5.6.0                    py36_5    conda-forge
python                    3.6.5                         1    conda-forge
python-dateutil           2.7.3                      py_0    conda-forge
pyzmq                     17.0.0                   py36_4    conda-forge
qt                        5.6.2                         7    conda-forge
qtconsole                 4.3.1                    py36_0    conda-forge
readline                  7.0                           0    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                39.2.0                   py36_0    conda-forge
shapely                   1.6.4                    py36_0    conda-forge
simplegeneric             0.8.1                    py36_0    conda-forge
sip                       4.18                     py36_1    conda-forge
six                       1.11.0                   py36_1    conda-forge
sqlite                    3.20.1                        2    conda-forge
terminado                 0.8.1                    py36_0    conda-forge
testpath                  0.3.1                    py36_0    conda-forge
tk                        8.6.7                         0    conda-forge
tornado                   5.0.2                    py36_0    conda-forge
traitlets                 4.3.2                    py36_0    conda-forge
util-linux                2.21                          0    defaults
wcwidth                   0.1.7                    py36_0    conda-forge
webencodings              0.5                      py36_0    conda-forge
wheel                     0.31.0                   py36_0    conda-forge
widgetsnbextension        3.2.1                    py36_0    conda-forge
xerces-c                  3.2.0                         0    conda-forge
xorg-libxau               1.0.8                         3    conda-forge
xorg-libxdmcp             1.1.2                         3    conda-forge
xz                        5.2.3                         0    conda-forge
zeromq                    4.2.5                         1    conda-forge
zlib                      1.2.11                        0    conda-forge

as you can see I got the same fiona as you "fiona 1.7.11 py36_3 conda-forge". Make sure you have json-c 0.12.1 0 conda-forge too there.

@yaph
Copy link

yaph commented May 24, 2018

I created a new environment and could import fiona without problems. In my existing environment I uninstalled json-c, which was version 0.13.1, then re-installed fiona, which triggered the installation of json-c 0.12.1. This environment now works too. Thanks for your help!

@gnfrazier
Copy link

Have the same issue in Geopandas. On conda install geopandas:

`The following NEW packages will be INSTALLED:

fiona:     1.7.11-py36_1        conda-forge
gdal:      2.1.3-py36_7         conda-forge
geopandas: 0.3.0-py36h2f9c1c0_0            
json-c:    0.13.1-h1bed415_0         `

Geopandas is pulling in the _1 version of fiona and json-c 0.13.1 causing the version conflict.

Not sure if I should file this issue here or on geopandas, please advise.

@ocefpaf
Copy link
Member

ocefpaf commented Jun 2, 2018

Conda is getting some old and unpinned build number to wiggle its way out of solving a more complex set of dependencies. I removed those to avoid giving conda the choice to do the wrong thing there. Can you try again? Note that you'll probably need to clear your cache. You'll know that you got the right fiona if it is build number 3.

@gnfrazier
Copy link

This worked. Thank you. Clearing cache was a step I had not taken.

@YassineAbdelouadoud
Copy link

I still have the same issue on python 2.7 with json-c being the 0.13.1 version and causing the ImportError (conda-forge channel on top of priority list and cache cleared). BTW, everything works fine on windows.

@ocefpaf
Copy link
Member

ocefpaf commented Jun 5, 2018

@YassineAbdelouadoud please send the steps to reproduce your environment and the results of conda list.

@YassineAbdelouadoud
Copy link

Steps to reproduce :

  • pulling docker image continuumio/miniconda:4.3.27
  • cloning a repository that contains, among other things, the environment file attached
  • apt-get update --fix-missing
  • apt-get install -y gcc make g++ python-qt4 libxml2-dev libxslt1-dev
  • conda update -n root conda
  • conda clean -t
  • conda clean -p
  • conda env create --quiet --force --file ci/dimosim_environment_linux.yml
  • do something that imports geopandas (in this case, install a package and run a test suite)

Attached are a text file containing the output of conda list and the env file (saved as txt to upload here)

dimosim_environment_linux.txt

conda_list_output.txt

@ocefpaf
Copy link
Member

ocefpaf commented Jun 5, 2018

For some reason you are getting fiona 1.7.10 and not 1.7.11.

Just unpinning the micro version of Python did the trick for me. However, if you want to force the right fiona, you can add it there like I did below:

name: dimosim
channels:
  - conda-forge
  - defaults
dependencies :
  - python=2.7
  - pandas
  - scipy
  - cython
  - numba
  - pytz
  - h5py
  - jupyter
  - pytables
  - matplotlib
  - seaborn
  - colorama
  - pytest
  - pyqtgraph
  - networkx<2.0
  - nb_conda
  - geopandas
  - rasterio
  - fiona=1.7.11
  - pip:
    - pyopengl
    - pytess
    - geojson
    - lxml
    - pytest-cov
    - tabulate
    - pyephem
    - multiprocess
    - pvlib
    - sphinx
    - nbsphinx
    - sphinx-autoapi
    - sphinxcontrib-fulltoc
    - sphinx_rtd_theme
    - geojson
    - pyproj
    - tqdm
    - xlwt

@YassineAbdelouadoud
Copy link

It turns out the pinning of the python micro version was not needed anymore so just unppining it worked like a charm. Thanks for your help !

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

5 participants