How can I resolve this error?

ImportError: /home/a/b.com/live-charts/live-chart-example/lib/python3.6/site-packages/osgeo/_gdal.cpython-36m-x86_64-linux-gnu.so: undefined symbol: GDALDatasetTestCapability


Gerrit's answer to a related question solved the undefined symbol: GDALDatasetTestCapability error for me:

If a gdal version is already installed, this problem will occur even if you have linked against the version installed in ~/.local. A solution is given at a Planet MYSQL post here:

In this case, we can tell the linker to preload our newer 1.11.0 library in our shell this way:

export LD_PRELOAD=/usr/local/lib/libgdal.so.1

Or, in my case,

export LD_PRELOAD="$HOME/.local/lib/libgdal.so.1"

Python gdal undefined symbol GDALRasterBandGetVirtualMem

  • You may also need to run, export LD_LIBRARY_PATH="/usr/local/lib/:$LD_LIBRARY_PATH" and ldconfig in order for the bindings to work. – JessieinAg Nov 28 '18 at 22:56
  • It would be helpful to have a comment on the down vote. This answer and information helped me resolve this exact error. – JessieinAg Nov 28 '18 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.