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

GDAL import fails with ImportError: libpoppler.so.71: cannot open shared object file: No such file or directory #10351

Closed
cclarkson opened this issue Nov 21, 2018 · 19 comments

Comments

@cclarkson
Copy link

The same issue as found in the closed issue #9449 has started happening again.

ON COMMAND LINE

conda install gdal
Solving environment: done
# All requested packages already installed.

IN JUPYTER NOTEBOOK

import gdal

ImportError                               Traceback (most recent call last)
<ipython-input-5-ee38efafc30b> in <module>()
----> 1 import gdal

~/Git/ag1000g-phase2-data-paper/deps/conda/envs/ag1000g-phase2-data-paper/lib/python3.6/site-packages/gdal.py in <module>()
      1 # import osgeo.gdal as a convenience
----> 2 from osgeo.gdal import deprecation_warn
      3 deprecation_warn('gdal')
      4 
      5 from osgeo.gdal import *

~/Git/ag1000g-phase2-data-paper/deps/conda/envs/ag1000g-phase2-data-paper/lib/python3.6/site-packages/osgeo/__init__.py in <module>()
     19                 fp.close()
     20             return _mod
---> 21     _gdal = swig_import_helper()
     22     del swig_import_helper
     23 else:

~/Git/ag1000g-phase2-data-paper/deps/conda/envs/ag1000g-phase2-data-paper/lib/python3.6/site-packages/osgeo/__init__.py in swig_import_helper()
     15         if fp is not None:
     16             try:
---> 17                 _mod = imp.load_module('_gdal', fp, pathname, description)
     18             finally:
     19                 fp.close()

~/Git/ag1000g-phase2-data-paper/deps/conda/envs/ag1000g-phase2-data-paper/lib/python3.6/imp.py in load_module(name, file, filename, details)
    241                 return load_dynamic(name, filename, opened_file)
    242         else:
--> 243             return load_dynamic(name, filename, file)
    244     elif type_ == PKG_DIRECTORY:
    245         return load_package(name, filename)

~/Git/ag1000g-phase2-data-paper/deps/conda/envs/ag1000g-phase2-data-paper/lib/python3.6/imp.py in load_dynamic(name, path, file)
    341         spec = importlib.machinery.ModuleSpec(
    342             name=name, loader=loader, origin=path)
--> 343         return _load(spec)
    344 
    345 else:

ImportError: libpoppler.so.76: cannot open shared object file: No such file or directory
@dahaynes
Copy link

What was the solution for this error? I recently built a new conda environment and ran into this error. Issue occurs when installing geopandas.

ImportError: libpoppler.so.76: cannot open shared object file: No such file or directory

@varpushaukka
Copy link

downgrading poppler worked for me (as suggested in #9449 )

conda install "poppler<0.62"

@mazzma12
Copy link

mazzma12 commented Mar 19, 2019

downgrading poppler worked for me (as suggested in #9449 )

conda install "poppler<0.62"

It did not work for me, I had to install with pip

@vicchu
Copy link

vicchu commented Jun 12, 2019

downgrading poppler worked for me (as suggested in #9449 )

conda install "poppler<0.62"

Thank you! It work for me。

@LuddeEklund
Copy link

conda install "poppler<0.62"

did not work for me!

@christine-e-smit
Copy link

It does not work for me either. I get "UnsatisfiableError".

@darribas
Copy link

darribas commented Aug 4, 2019

I'm running into similar problems. With some the libraries I want to install on the environment, poppler<0.62 is too old and throws compatibility errors.

@christine-e-smit
Copy link

I found that if I removed conda-forge and used the default channel, I got a version of gdal that used popper<0.62 which worked. But I'm worried that the default channel will get updated at some point and gdal will stop installing.

@LuddeEklund
Copy link

If I removed conda-forge and installed geopandas with default (conda installed), it worked for me too!

@lamhydro
Copy link

lamhydro commented Sep 5, 2019

This works for me:

  1. Remove conda-forge from .condarc and leave the default channell only
  2. type conda update --all, this will update your packages using the default channel.
  3. Install (or reinstall) gdal using conda install gdal. This will downgrade poppler lib to the right version for gdal.
  4. to test type python -c 'import gdal; print(dir(gdal))'

@LenaVolzhina
Copy link

Addition to the last comment: to reinstall gdal you should use conda install gdal --force-reinstall. After this I was finally able to import gdal! Thank you, @lamhydro.

@skeller88
Copy link

@cclarkson can this issue be reopened? I'm not sure why it was closed. I'm seeing the issue as well.

@lk137095576
Copy link

downgrading poppler worked for me (as suggested in #9449 )

conda install "poppler<0.62"

It works for me ! perfect

@CaoHoangTung
Copy link

CaoHoangTung commented Nov 2, 2021

I tried all the above solution and nothing seems to work. A similar error message occurred!

ImportError: libpoppler.so.91: cannot open shared object file: No such file or directory

I'm using gdal 3.0.2 on python 3.6, ubuntu 20.04 LTS

@nvogtvincent
Copy link

nvogtvincent commented Nov 23, 2021

I tried all the above solution and nothing seems to work. A similar error message occurred!

ImportError: libpoppler.so.91: cannot open shared object file: No such file or directory

I'm using gdal 3.0.2 on python 3.6, ubuntu 20.04 LTS

Forcing an upgrade to poppler solves this for me. By default, conda installs poppler-0.89 and gdal-3.0.2. This triggers the libpoppler.so.91 error. Attempting to upgrade poppler in an existing environment (conda install -c conda-forge poppler=21.09) brings up complaints about incompatability. If I instead set up a new environment and specify the poppler version upon environment creation, it installs the specified poppler version (21.09 worked for me) and gdal-3.3.3. This runs with no issues in my configuration.

@SamratSinghRathore
Copy link

Try
pip install poppler-utils
followed by
conda install poppler

@DanRunfola
Copy link

@SamratSinghRathore thank you, that worked for my configuration. Not sure why it worked, but it did :)

@erkdiwakar2021
Copy link

Hi everybody, I am using Ubuntu 22.04.3 LTS operating system, python 3.11.5 and conda 23.9.0. I tried to run GDAL through the jupyter notebook but i am facing the error as the error displays as follows: ---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
File ~/anaconda3/envs/jupy/lib/python3.11/site-packages/osgeo/init.py:30, in swig_import_helper()
29 try:
---> 30 return importlib.import_module(mname)
31 except ImportError:

File ~/anaconda3/envs/jupy/lib/python3.11/importlib/init.py:126, in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)

File :1204, in _gcd_import(name, package, level)

File :1176, in find_and_load(name, import)

File :1147, in find_and_load_unlocked(name, import)

File :676, in _load_unlocked(spec)

File :573, in module_from_spec(spec)

File :1233, in create_module(self, spec)

File :241, in _call_with_frames_removed(f, *args, **kwds)

ImportError: libpoppler.so.126: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import osgeo.gdal as gdal

File ~/anaconda3/envs/jupy/lib/python3.11/site-packages/osgeo/init.py:46
42 raise ImportError(traceback_string + '\n' + msg)
43 return importlib.import_module('_gdal')
---> 46 _gdal = swig_import_helper()
47 del swig_import_helper
49 version = _gdal.version = _gdal.VersionInfo("RELEASE_NAME")

File ~/anaconda3/envs/jupy/lib/python3.11/site-packages/osgeo/init.py:43, in swig_import_helper()
41 traceback_string = ''.join(traceback.format_exception(*sys.exc_info()))
42 raise ImportError(traceback_string + '\n' + msg)
---> 43 return importlib.import_module('_gdal')

File ~/anaconda3/envs/jupy/lib/python3.11/importlib/init.py:126, in import_module(name, package)
124 break
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)

ModuleNotFoundError: No module named '_gdal' Can anyone suggest me how can i solve this problem. Any suggestion will be highly appreciable.

@EduardoZB
Copy link

I tried all the above solution and nothing seems to work. A similar error message occurred!

ImportError: libpoppler.so.91: cannot open shared object file: No such file or directory

I'm using gdal 3.0.2 on python 3.6, ubuntu 20.04 LTS

Forcing an upgrade to poppler solves this for me. By default, conda installs poppler-0.89 and gdal-3.0.2. This triggers the libpoppler.so.91 error. Attempting to upgrade poppler in an existing environment (conda install -c conda-forge poppler=21.09) brings up complaints about incompatability. If I instead set up a new environment and specify the poppler version upon environment creation, it installs the specified poppler version (21.09 worked for me) and gdal-3.3.3. This runs with no issues in my configuration.

This one worked for me! I checked typing ogrinfo --version into my terminal and it returned my version (GDAL 3.3.2). Thank You kind sir!

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