2

Attempting to install PDAL for python via PIP in a virtual environment is resulting in a config error.

I have installed PDAL by building it with cmake and ninja, and added the /pdal/bin folder to the environment path via export through console and the ~/.bashrc. I can run pdal commands normally, however am receiving an error when attempting to run "pip install pdal" for not having a pdal-config available.

using: $ export PATH="$PATH:/PDAL-1.7.2-src/build/bin/" PDAL commands work from console

sudo pip install pdal

ERROR:

ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "/tmp/pip-install-cm90jl7u/pdal/setup.py", line 64, in get_pdal_config
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
      File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'pdal-config': 'pdal-config'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-cm90jl7u/pdal/setup.py", line 120, in <module>
        for item in get_pdal_config('--python-version').split():
      File "/tmp/pip-install-cm90jl7u/pdal/setup.py", line 68, in get_pdal_config
        'Could not find pdal-config %r: %s' % (pdal_config, ex))
    OSError: Could not find pdal-config 'pdal-config': [Errno 2] No such file or directory: 'pdal-config': 'pdal-config'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-cm90jl7u/pdal/
ClockworkKettle
  • 136
  • 1
  • 8
  • 1
    Try [`conda install -c conda-forge pdal python-pdal gdal`](https://pdal.io/download.html#conda). – phd May 10 '19 at 16:03
  • `sudo pip install pdal` ignores your `$PATH`. You should set `$PATH` for the shell ran by `sudo`. Something like `sudo su -` and in the root shell `PATH=/PDAL-1.7.2-src/build/bin:$PATH pip install pdal`. – phd May 10 '19 at 16:06

1 Answers1

0

try a new env:

conda create -n pdal
conda activate pdal
conda install -c conda-forge pdal python-pdal gdal