Search code examples
pythondockerpipdockerfileliblas

Installing libLAS on docker python - No such file or directory


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?


Solution

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