PDAL / python

PDAL's Python Support
Other
116 stars 34 forks source link

Python-PDAL Docker file guidance #113

Closed SamPUG closed 2 years ago

SamPUG commented 2 years ago

I am struggling to create a Dockerfile with Python-pdal.

I have tried the suggestions from #81 and #56, but the output of pdal --drivers shows no filters.python. It seems that they were working at a time when the pdal Dockerfile was quite different.

I have also tried using a conda based Dockerfile which again, doesn't show filters.python in the output of pdal --drivers:

FROM continuumio/miniconda3

RUN conda create -n pdal -c conda-forge python-pdal -y

ENV CONDAENV "/opt/conda/envs/pdal"
ENV PATH $PATH:${CONDAENV}/bin

If I open a shell in this container, I find that while I am in the base conda environment. The command python -m pdal returns:

/opt/conda/bin/python: No module named pdal.__main__; 'pdal' is a package and cannot be directly executed

whereas when I activate the pdal env, i get:

Traceback (most recent call last):
  File "/opt/conda/envs/pdal/lib/python3.10/runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/opt/conda/envs/pdal/lib/python3.10/runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/opt/conda/envs/pdal/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/opt/conda/envs/pdal/lib/python3.10/site-packages/pdal/__init__.py", line 4, in <module>
    from . import libpdalpython
ImportError: libpdal_base.so.13: cannot open shared object file: No such file or directory

This is the reverse of what I would expect as the pdal environment is where pdal-python is installed.

I was wondering if there are any working examples of Dockerfiles for Python-pdal for the current pdal image?

hobu commented 2 years ago

Sorry this is so much trouble. I'm currently working to push out a new release of pdal-python that should address this. Now that the PDAL 2.4 release is out, it can move forward.

The python-pdal conda package needs its pins set more accurately so that it grabs the correct PDAL version (in the case above it should be PDAL 2.3 but I think 2.4 was grabbed).

hobu commented 2 years ago

This should be fixed with the latest conda packages. Please re-test and reopen this ticket if otherwise.