我在 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问题吗?
最佳答案
您需要安装 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
关于python - 从源代码安装时,laspy 找不到 laszip。 laszip 在路径中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49500149/