Installing libLAS on docker python - No such file or directory

774 views Asked by At

I'm working in python in docker, and I need to add the package libLAS.

I usually just add a simple line to my dockerfile, for libLAS it would is:

Run pip install liblas

Docker seems to be able to build the image, but when I run a python script with the line:

import liblas

it gives the error:

Traceback (most recent call last):
  File "/src/test.py", line 6, in <module>
    import liblas
  File "/usr/local/lib/python2.7/dist-packages/liblas/__init__.py", line 2, in <module>
    from .core import get_version
  File "/usr/local/lib/python2.7/dist-packages/liblas/core.py", line 158, in <module>
    las = ctypes.CDLL(lib_name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: liblas_c.so.3: cannot open shared object file: No such file or directory

I don't know what this error message means. Can someone please tell me how I can use liblas in python on docker?

2

There are 2 answers

2
julian salas On BEST ANSWER

You can add RUN apt-get -y install liblas-c3 in your Dockerfile and then Docker build . to install it.

0
Salem On

You are just installing the python bindings. You need also to install liblas itself. If you are using Ubuntu/Debian, try

$ apt-get install liblas-c3