【问题标题】:laspy cannot find laszip when is installed from source. laszip is in pathlaspy 从源代码安装时找不到 laszip。 laszip 在路径中
【发布时间】:2018-09-05 02:39:28
【问题描述】:

我正在使用 HPC 环境并且没有 root 访问权限。我从源代码安装了 laszip。

从源代码安装 laszip

module load git
git clone https://github.com/LASzip/LASzip.git
git checkout tags/2.0.2
cd LASzip

在构建目录中创建文件。

mkdir build
cd build
module load cmake
module load gcc
cmake .. -DCMAKE_INSTALL_PREFIX=/home/b.weinstein/LASzip/build 
make
make install

添加路径

export LD_LIBRARY_PATH="/home/b.weinstein/LASzip/build/lib:$LD_LIBRARY_PATH"
export PATH="/home/b.weinstein/LASzip/build/bin:$PATH"

确保它在本地工作

(pangeo) [b.weinstein@c30a-s26 bin]$ pwd
/home/b.weinstein/LASzip/build/bin
(pangeo) [b.weinstein@c30a-s26 bin]$ laszip-config --version
2.0.2

转到一个新目录以测试链接

cd ~
(pangeo) [b.weinstein@c30a-s26 ~]$ laszip-config --version
2.0.2

python 测试

(pangeo) [b.weinstein@c30a-s26 ~]$ python
Python 3.6.4 | packaged by conda-forge | (default, Dec 23 2017, 16:31:06) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import laspy
>>> test_file=laspy.file.File("/ufrc/ewhite/s.marconi/NeonData/2017_Campaign/D03/OSBS/L1/DiscreteLidar/ClassifiedPointCloud/NEON_D03_OSBS_DP1_412000_3283000_classified_point_cloud.laz")
Traceback (most recent call last):
  File "/home/b.weinstein/miniconda3/envs/pangeo/lib/python3.6/site-packages/laspy/base.py", line 204, in map
    self._mmap=FakeMmap(self.filename)
  File "/home/b.weinstein/miniconda3/envs/pangeo/lib/python3.6/site-packages/laspy/base.py", line 57, in __init__
    data = read_compressed(filename)
  File "/home/b.weinstein/miniconda3/envs/pangeo/lib/python3.6/site-packages/laspy/base.py", line 37, in read_compressed
    raise(laspy.util.LaspyException("Laszip was not found on the system"))
laspy.util.LaspyException: Laszip was not found on the system

我如何告诉 laspy 在哪里寻找 laszip?这是pythonpath的问题吗?

【问题讨论】:

    标签: python liblas laspy


    【解决方案1】:

    你需要安装laszip-cli应用程序

    git clone https://github.com/LASzip/LASzip.git
    cd LASzip
    git checkout 3.1.0
    cmake .
    make
    sudo make install
    cd ..
    wget http://lastools.org/download/LAStools.zip
    unzip LAStools.zip
    cd LAStools
    make
    sudo cp bin/laszip /usr/local/bin
    sudo ln -s /usr/local/bin/laszip /usr/local/bin/laszip-cli
    

    【讨论】:

    • @Prateek 在 Windows 中怎么做?
    • @Sajjadmanal 您可以将带有 laszip.exe 的目录添加到要找到的 %PATH% 变量中。
    • 我必须将第二个网址更改为 https://lastools.github.io/download/LAStools.zip 才能正常工作。
    【解决方案2】:

    对于 Windows 用户:

    1. 从“https://rapidlasso.com/laszip/”下载 Laszip.exe
    2. 将 laszip.exe 的路径添加到 User_Variables 和 System_Variables 中的 %PATH%

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      相关资源
      最近更新 更多