簡體   English   中英

從源安裝時,laspy 找不到 laszip。 laszip 在路徑中

[英]laspy cannot find laszip when is installed from source. laszip is in path

我在 HPC 環境中工作,沒有根訪問權限。 我從源代碼安裝了 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問題嗎?

您需要安裝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

對於 Windows 用戶:

  1. 從“https://rapidlasso.com/laszip/”下載 Laszip.exe
  2. 將 laszip.exe 的路徑添加到 User_Variables 和 System_Variables 中的 %PATH%

具有root訪問權限的構建過程僅供記錄。

設置構建環境

sudo apt install  -y --fix-missing --no-install-recommends \
build-essential ca-certificates cmake git libboost-all-dev

構建並安裝 LASzip

git clone https://github.com/LASzip/LASzip.git
mkdir LASzip/build && cd LASzip/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install

構建並安裝 LAStools

git clone https://github.com/LAStools/LAStools.git
mkdir LAStools/build && cd LAStools/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM