我 pip 安装了 liblas,它安装得很好,但是,当我尝试导入 liblas 时,它会引发一个错误,显示在第一个错误中。
然后我 pip 安装了 laspy,它安装得很好,并尝试使用 laspy.file.File 从该文件中读取我的 las 文件,但它再次向我提出了一个错误,显示在第二个错误中
OSError Traceback (most recent call last)
<ipython-input-6-7ba94c832967> in <module>
----> 1 import liblas
C:\ProgramData\Anaconda3\lib\site-packages\liblas\__init__.py in <module>
1 #from .core import *
----> 2 from .core import get_version
3 from .core import las
4 version = get_version()
5 HAVE_GDAL = bool(las.LAS_IsGDALEnabled())
C:\ProgramData\Anaconda3\lib\site-packages\liblas\core.py in <module>
137 original_path = os.environ['PATH']
138 os.environ['PATH'] = "%s;%s" % (local_dlls, original_path)
--> 139 las = ctypes.CDLL(lib_name)
140
141 def free(m):
C:\ProgramData\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
354
355 if handle is None:
--> 356 self._handle = _dlopen(self._name, mode)
357 else:
358 self._handle = handle
OSError: [WinError 126] The specified module could not be found
LaspyException Traceback (most recent call last)
<ipython-input-5-20f5fbf35bba> in <module>
----> 1 inFile = File('2_DLL.las', mode='r')
C:\ProgramData\Anaconda3\lib\site-packages\laspy\file.py in __init__(self, filename, header, vlrs, mode, in_srs, out_srs, evlrs)
62 self.in_srs = in_srs
63 self.out_srs = out_srs
---> 64 self.open()
65
66 def open(self):
C:\ProgramData\Anaconda3\lib\site-packages\laspy\file.py in open(self)
73 ## Make sure we have a header
74 if self._header is None:
---> 75 self._reader = base.Reader(self.filename, mode=self._mode)
76 self._header = self._reader.get_header()
77 else:
C:\ProgramData\Anaconda3\lib\site-packages\laspy\base.py in __init__(self, filename, mode, header, vlrs, evlrs)
271 self.padded = False
272 if self.mode in ("r", "r-"):
--> 273 self.setup_read_write(vlrs,evlrs, read_only=True)
274 return
275 elif self.mode == "rw":
C:\ProgramData\Anaconda3\lib\site-packages\laspy\base.py in setup_read_write(self, vlrs, evlrs, read_only)
300 self.data_provider.open(open_mode)
301 self.data_provider.map()
--> 302 self.header_format = laspy.util.Format("h" + self.grab_file_version())
303 self.get_header(self.grab_file_version())
304 self.populate_vlrs()
C:\ProgramData\Anaconda3\lib\site-packages\laspy\util.py in __init__(self, fmt, overwritable, extra_bytes, extradims)
150 "EVLR", "h1.0", "h1.1", "h1.2", "h1.3", "h1.4",
151 "extra_bytes_struct", "None")):
--> 152 raise LaspyException("Invalid format: " + str(fmt))
153 if self.fmt == None:
154 return
LaspyException: Invalid format: h82.83