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

libpoppler.so.71: cannot open shared object file: No such file or directory #104

Closed
xigrug opened this issue Dec 30, 2017 · 19 comments · Fixed by #137
Closed

libpoppler.so.71: cannot open shared object file: No such file or directory #104

xigrug opened this issue Dec 30, 2017 · 19 comments · Fixed by #137
Labels
bug Something isn't working

Comments

@xigrug
Copy link

xigrug commented Dec 30, 2017

>>> import gmt
Traceback (most recent call last):
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/site-packages/gmt/clib/utils.py", line 159, in load_libgmt
    libgmt = ctypes.CDLL('.'.join([libname, clib_extension()]))
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libpoppler.so.71: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/site-packages/gmt/__init__.py", line 27, in <module>
    _begin()
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/site-packages/gmt/session_management.py", line 17, in begin
    with LibGMT() as lib:
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/site-packages/gmt/clib/core.py", line 103, in __init__
    self._bind_clib_functions(libname)
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/site-packages/gmt/clib/core.py", line 136, in _bind_clib_functions
    self._libgmt = load_libgmt(libname)
  File "/users1j/cliu/soft/anaconda2/envs/gmt-python/lib/python3.6/site-packages/gmt/clib/utils.py", line 168, in load_libgmt
    raise GMTCLibNotFoundError(msg)
gmt.exceptions.GMTCLibNotFoundError: Couldn't find the GMT shared library 'libgmt'. Have you tried setting the LD_LIBRARY_PATH environment variable?
Original error message:

    libpoppler.so.71: cannot open shared object file: No such file or directory
@xigrug
Copy link
Author

xigrug commented Jan 1, 2018

I change the LD_LIBRARY_PATH. It can be imported now,but it does not work

@leouieda
Copy link
Member

leouieda commented Jan 9, 2018

Hi @xigrug thinks seems to be a problem with a GDAL dependency (conda-forge/osmnx-feedstock#23). Can you try deleting your environment and reinstalling everything? It might have been fixed already. If not, please report back.

@leouieda leouieda added the bug Something isn't working label Feb 12, 2018
@adamnicholasprice
Copy link

adamnicholasprice commented Feb 25, 2018

I have the same problem on my end. Fresh install.

Here is the output:

>>> import gmt
Traceback (most recent call last):
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/site-packages/gmt/clib/utils.py", line 159, in load_libgmt
    libgmt = ctypes.CDLL('.'.join([libname, clib_extension()]))
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(libgmt.dylib, 6): Library not loaded: @rpath/libpoppler.71.dylib
  Referenced from: /Users/adamprice/anaconda/envs/gmtpy/lib/libgdal.20.dylib
  Reason: image not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/site-packages/gmt/__init__.py", line 28, in <module>
    _begin()
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/site-packages/gmt/session_management.py", line 17, in begin
    with LibGMT() as lib:
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/site-packages/gmt/clib/core.py", line 103, in __init__
    self._bind_clib_functions(libname)
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/site-packages/gmt/clib/core.py", line 136, in _bind_clib_functions
    self._libgmt = load_libgmt(libname)
  File "/Users/adamprice/anaconda/envs/gmtpy/lib/python3.6/site-packages/gmt/clib/utils.py", line 168, in load_libgmt
    raise GMTCLibNotFoundError(msg)
gmt.exceptions.GMTCLibNotFoundError: Couldn't find the GMT shared library 'libgmt'. Have you tried setting the LD_LIBRARY_PATH environment variable? 
Original error message: 

    dlopen(libgmt.dylib, 6): Library not loaded: @rpath/libpoppler.71.dylib
  Referenced from: /Users/adamprice/anaconda/envs/gmtpy/lib/libgdal.20.dylib
  Reason: image not found

@leouieda
Copy link
Member

@adamnicholasprice thanks for reporting the issue.

Did you follow the instructions in http:https://www.gmtpython.xyz/install.html for installing in a conda environment? If so, could you please post the output of conda list?

@adamnicholasprice
Copy link

adamnicholasprice commented Feb 26, 2018

Yes I followed the install instructions (even cloned the git on the second time install).

(gmt-python)adamprice$ conda list
# packages in environment at /Users/adamprice/anaconda/envs/gmt-python:
#
# Name                    Version                   Build  Channel
appnope                   0.1.0                    py36_0    conda-forge
attrs                     17.4.0                     py_0    conda-forge
backports                 1.0                      py36_1    conda-forge
backports.functools_lru_cache 1.5                      py36_0    conda-forge
blas                      1.1                    openblas    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.1.18                     0    conda-forge
cairo                     1.14.10                       0    conda-forge
certifi                   2018.1.18                py36_0    conda-forge
curl                      7.55.1                        0    conda-forge
cycler                    0.10.0                   py36_0    conda-forge
dcw-gmt                   1.1.2                         0    conda-forge
decorator                 4.1.2                    py36_0    conda-forge
expat                     2.2.5                         0    conda-forge
fftw                      3.3.7                         0    conda-forge
fontconfig                2.12.6                        0    conda-forge
freetype                  2.8.1                         0    conda-forge
freexl                    1.0.4                         0    conda-forge
gdal                      2.2.2            py36hd505dc6_1  
geos                      3.6.2                         1    conda-forge
gettext                   0.19.8.1                      0    conda-forge
ghostscript               9.22                          0    conda-forge
giflib                    5.1.4                         0    conda-forge
glib                      2.55.0                        0    conda-forge
gmt                       6.0.0a12        blas_openblas_201  [blas_openblas]  conda-forge/label/dev
gmt-python                0.1a3+61.gdfb0720           <pip>
gshhg-gmt                 2.3.7                         0    conda-forge
hdf4                      4.2.13                        0    conda-forge
hdf5                      1.10.1                        2    conda-forge
icu                       58.2                          0    conda-forge
ipython                   6.2.1                    py36_1    conda-forge
ipython_genutils          0.2.0                    py36_0    conda-forge
jedi                      0.11.1                   py36_0    conda-forge
jpeg                      9b                            2    conda-forge
json-c                    0.12.1                        0    conda-forge
kealib                    1.4.7                         4    conda-forge
krb5                      1.14.2                        0    conda-forge
libcxx                    4.0.1                h579ed51_0  
libcxxabi                 4.0.1                hebd6815_0  
libdap4                   3.19.2                        1    conda-forge
libedit                   3.1                  hb4e282d_0  
libffi                    3.2.1                h475c297_4  
libgdal                   2.2.2                h3559a57_1  
libgfortran               3.0.0                         0    conda-forge
libiconv                  1.15                          0    conda-forge
libkml                    1.3.0                         6    conda-forge
libnetcdf                 4.4.1.1                      10    conda-forge
libpng                    1.6.34                        0    conda-forge
libpq                     9.6.6                h77f6c7a_0  
libspatialite             4.3.0a              h0a2fa02_18  
libssh2                   1.8.0                         2    conda-forge
libtiff                   4.0.9                         0    conda-forge
libxml2                   2.9.7                         0    conda-forge
matplotlib                2.1.2                    py36_0    conda-forge
ncurses                   6.0                  hd04f020_2  
nose                      1.3.7                    py36_2    conda-forge
numpy                     1.14.1          py36_blas_openblas_200  [blas_openblas]  conda-forge
openblas                  0.2.20                        7    conda-forge
openjpeg                  2.3.0                         2    conda-forge
openssl                   1.0.2n                        0    conda-forge
pandas                    0.22.0                   py36_0    conda-forge
parso                     0.1.1                      py_0    conda-forge
pcre                      8.39                          0    conda-forge
pexpect                   4.4.0                    py36_0    conda-forge
pickleshare               0.7.4                    py36_0    conda-forge
pip                       9.0.1            py36h1555ced_4  
pixman                    0.34.0                        1    conda-forge
pluggy                    0.6.0                      py_0    conda-forge
poppler                   0.61.1                        3    conda-forge
poppler-data              0.4.8                         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
py                        1.5.2                      py_0    conda-forge
pygments                  2.2.0                    py36_0    conda-forge
pyparsing                 2.2.0                    py36_0    conda-forge
pytest                    3.4.1                    py36_0    conda-forge
pytest-mpl                0.9                        py_0    conda-forge
python                    3.6.4                hc167b69_1  
python-dateutil           2.6.1                    py36_0    conda-forge
pytz                      2018.3                     py_0    conda-forge
readline                  7.0                  hc1231fa_4  
setuptools                38.5.1                   py36_0  
simplegeneric             0.8.1                    py36_0    conda-forge
six                       1.11.0                   py36_1    conda-forge
sqlite                    3.22.0               h3efe00b_0  
tk                        8.6.7                h35a86e2_3  
tornado                   4.5.3                    py36_0    conda-forge
traitlets                 4.3.2                    py36_0    conda-forge
wcwidth                   0.1.7                    py36_0    conda-forge
wheel                     0.30.0           py36h5eb2c71_1  
xerces-c                  3.2.0                         0    conda-forge
xz                        5.2.3                h0278029_2  
zlib                      1.2.11               hf3cbc9b_2 

@leouieda
Copy link
Member

leouieda commented Feb 27, 2018

@adamnicholasprice thanks! I think I see a problem. Your gdal isn't coming from conda-forge for some reason but poppler is. That might be causing the linking issue. Could you try the following please?

  1. Delete the gmt-python environment:
conda env remove --name gmt-python
  1. Create (or edit) a .condarc file in your home directory to include this (it will make conda-forge a priority):
channels:
  - conda-forge
  - defaults
  1. Repeat the install process. If things don't work, check conda list to see if gdal is coming from the conda-forge channel and report back.

More information about these issues on the conda-forge documentation: https://conda-forge.org/docs/conda-forge_gotchas.html

@adamnicholasprice
Copy link

@leouieda That did not work for me but I was able to resolve it using the instructions in https://github.com/conda-forge/gdal-feedstock . Looking forward to using the package!

@leouieda
Copy link
Member

I'm glad it's working! Would you mind sharing what you did so that we can have it as a reference?

Also, did you check if your gdal is now coming from conda-forge?

@adamnicholasprice
Copy link

This is the line of syntax seemed to have fixed by issue.

source activate [env-name]
conda config --add channels conda-forge
conda install gdal

After which run the

conda list

command to make sure packages are coming from conda-forge

@btozer
Copy link
Contributor

btozer commented Mar 7, 2018

I had the same issue this morning. @adamnicholasprice solution also worked for me. Thanks!

@leouieda
Copy link
Member

leouieda commented Mar 7, 2018

@btozer thanks for reporting. I'll add these instructions to the documentation.

leouieda added a commit that referenced this issue Mar 7, 2018
Not having conda-forge in the conda config can cause problems with
conflicting versions of gdal and other dependencies.
This can be fixed by calling `conda config` before doing anything.
The added advantage is that we don't need the `-c conda-forge` in every
conda command anymore.

Fixes #104
leouieda added a commit that referenced this issue Mar 7, 2018
Not having conda-forge in the conda config can cause problems with
conflicting versions of gdal and other dependencies.
This can be fixed by calling `conda config` before doing anything.
The added advantage is that we don't need the `-c conda-forge` in every
conda command anymore.

Fixes #104
@leouieda
Copy link
Member

leouieda commented Mar 7, 2018

I've updated the install instructions to reflect the solution by @adamnicholasprice: http:https://www.gmtpython.xyz/install.html#installing-gmt-and-other-dependencies

Could anyone please give it a try to see if it works in machines other than mine?

@DennisScuba
Copy link

DennisScuba commented May 25, 2018

Hi, I'm very new to Python and Anaconda and tried to reproduce the mentioned steps, but sadly the error still occur:

runfile('/media/mattes/data1/dataDMattes/Code/Python/PythonProgram/main.py', wdir='/media/mattes/data1/dataDMattes/Code/Python/PythonProgram')
Traceback (most recent call last):

  File "<ipython-input-1-e8fdc416f3c8>", line 1, in <module>
    runfile('/media/mattes/data1/dataDMattes/Code/Python/PythonProgram/main.py', wdir='/media/mattes/data1/dataDMattes/Code/Python/PythonProgram')

  File "/home/mattes/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
    execfile(filename, namespace)

  File "/home/mattes/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "/media/mattes/data1/dataDMattes/Code/Python/PythonProgram/main.py", line 16, in <module>
    import ogr

  File "/home/mattes/anaconda3/lib/python3.6/site-packages/ogr.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn

  File "/home/mattes/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()

  File "/home/mattes/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)

  File "/home/mattes/anaconda3/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)

  File "/home/mattes/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)

ImportError: /home/mattes/anaconda3/lib/python3.6/site-packages/osgeo/../../.././libkea.so.1.4: undefined symbol: _ZN2H56H5FileC1ERKSsjRKNS_17FileCreatPropListERKNS_15FileAccPropListE

The output of my conda list is the following:

(gmt-python) mattes@gipc163:~$ conda list
# packages in environment at /home/mattes/anaconda3/envs/gmt-python:
#
# Name                    Version                   Build  Channel
blas                      1.1                    openblas    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
curl                      7.60.0                        0    conda-forge
dcw-gmt                   1.1.3                         0    conda-forge
expat                     2.2.5                         0    conda-forge
fftw                      3.3.7                         0    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
ghostscript               9.22                          0    conda-forge
giflib                    5.1.4                         0    conda-forge
glib                      2.55.0                        0    conda-forge
gmt                       5.4.3           blas_openblas_202  [blas_openblas]  conda-forge
gshhg-gmt                 2.3.7                         0    conda-forge
hdf4                      4.2.13                        0    conda-forge
hdf5                      1.10.1                        2    conda-forge
icu                       58.2                          0    conda-forge
jpeg                      9b                            2    conda-forge
json-c                    0.12.1                        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
libgdal                   2.2.4                         2    conda-forge
libgfortran               3.0.0                         1  
libiconv                  1.15                          0    conda-forge
libkml                    1.3.0                         6    conda-forge
libnetcdf                 4.6.1                         2    conda-forge
libpng                    1.6.34                        0    conda-forge
libpq                     9.6.3                         0    conda-forge
libspatialite             4.3.0a                       19    conda-forge
libssh2                   1.8.0                         2    conda-forge
libtiff                   4.0.9                         0    conda-forge
libxml2                   2.9.8                         0    conda-forge
ncurses                   5.9                          10    conda-forge
numpy                     1.14.3          py36_blas_openblas_200  [blas_openblas]  conda-forge
openblas                  0.2.20                        7    conda-forge
openjpeg                  2.3.0                         2    conda-forge
openssl                   1.0.2o                        0    conda-forge
pandas                    0.23.0                   py36_1    conda-forge
pcre                      8.41                          1    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
python                    3.6.5                         1    conda-forge
python-dateutil           2.7.3                      py_0    conda-forge
pytz                      2018.4                     py_0    conda-forge
readline                  7.0                           0    conda-forge
setuptools                39.2.0                   py36_0    conda-forge
six                       1.11.0                   py36_1    conda-forge
sqlite                    3.20.1                        2    conda-forge
tk                        8.6.7                         0    conda-forge
util-linux                2.21                          0  
wheel                     0.31.0                   py36_0    conda-forge
xerces-c                  3.2.0                         0    conda-forge
xz                        5.2.3                         0    conda-forge
zlib                      1.2.11                        0    conda-forge

@AloshkaD
Copy link

@DennisScuba I've had the same issue as yours and ended up building a new conda env.

@leouieda
Copy link
Member

@DennisScuba and @AloshkaD yes, please use a separate environment for now. Also, notice that you have the wrong version of GMT (5.4.3 instead of 6.0.0).

@hammytheham
Copy link

I know this is closed but......I had a lot of problem recently with these issues. gmt would switch down to 5.4 when trying to work the conda-forge feedstock, having errors like @rpath/libpoppler.76.dylib
Referenced from: /anaconda3/envs/gmt-python/lib/libgdal.20.dylib.

I checked my conda list and gdal was from the conda feedstock. But libgdal wasnt. So..

conda install -c conda-forge libgdal

This worked.

Great program - Only thing with the install instructions I would say may help is to link/integrate the install instructions to the feedstock instructions a little more. Just a bit of friendly feedback - feel free to ignore if Im being an idiot! I got a little confused - thanks :)

@leouieda
Copy link
Member

Hi @hammytheham, thanks for the feedback!

Just a bit of friendly feedback - feel free to ignore if Im being an idiot! I got a little confused - thanks :)

Not at all! This has been a major problem from the start and a constant source of headaches for me :) Conda-forge is a relatively new resource and things are still a bit unstable. They have been doing a lot of work to get things better integrated with the default Anaconda. This will hopefully solve a large amount of these issues. I'm constantly tweaking this process but it's really hard to prepare for these errors since I don't get them.

Also, I really love to get contributions of this kind! The only way to have a robust set of install instructions is if people with diverse setups contribute to it. Would you like to try adding some words to the instructions? I would really appreciate it if you could help clarify what you found confusing and what eventually cleared things up.

You can do that online by going to https://github.com/GenericMappingTools/gmt-python/blob/master/doc/install.rst and clicking in the little pencil icon.

@hammytheham
Copy link

Done :)

@prativadas
Copy link

I was having the same issue. so i opened anaconda navigator and go to the env. then in the channels, you can see default and conda-forge so you can delete conda-forge. then again install gdal, poppler. both will be available on default channel. this works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants