1

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?

shad0w_wa1k3r
  • 11,346
  • 8
  • 59
  • 80
Little geek
  • 549
  • 6
  • 18

2 Answers2

2

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

julian salas
  • 2,254
  • 16
  • 20
  • This works perfectly! I made this the accepted answer because -y is needed so it doesn't abort because it needs more space. – Little geek Apr 07 '17 at 09:20
  • Where did you get this command? Is there somewhere to look it up or something? I need to install pdal now, and I keep running into this problem... – Little geek Apr 24 '17 at 13:03
0

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
Salem
  • 12,060
  • 3
  • 30
  • 50