What is the Laspy error when reading laz files?

5k Views Asked by At
import laspy 
import open3d as o3d
import numpy as np

las = laspy.read("file.laz")

When I use this code, I get the error: laspy.errors.LaspyException: No LazBackend selected, cannot decompress data

How can I resolve this?

2

There are 2 best solutions below

1
On

The laspy website explains how to enable filehandling of .laz files.

https://laspy.readthedocs.io/en/latest/installation.html#

You have to install one of the two given .laz backends. On the top of the page are installation examples.

With unix/macOS this worked for me:

python3 -m pip install "laspy[lazrs,laszip]"

Make sure to reload your python environment after the installation.

0
On

I also had the same issue and unfortunately, while working in colab, installing the laspy tool and the dependancies for .laz files using !pip install laspy[lazrs,laszip] did not help in reading the .laz file. Luckily, Qgis has the tool to convert from .las to .laz found in the Processing Toolbox > Point Cloud Conversion > Convert format. It also has the option of batch processing as well.