Have some problem with PDAL lib. After the library installation tried to import pdal
and the error has been rised:
JSONDecodeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_17208/3968280360.py in <module>
----> 1 import pdal
~\anaconda3\lib\site-packages\pdal\__init__.py in <module>
6 from .pipeline import Filter, Pipeline, Reader, Stage, Writer
7
----> 8 inject_pdal_drivers()
9 dimensions = libpdalpython.getDimensions()
10 info = libpdalpython.getInfo()
~\anaconda3\lib\site-packages\pdal\drivers.py in inject_pdal_drivers()
68 # options = libpdalpython.getOptions()
69
---> 70 drivers = json.loads(
71 subprocess.run(["pdal", "--drivers", "--showjson"], capture_output=True).stdout
72 )
~\anaconda3\lib\json\__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
348 cls = JSONDecoder
~\anaconda3\lib\json\decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):
~\anaconda3\lib\json\decoder.py in raw_decode(self, s, idx)
351 """
352 try:
--> 353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
355 raise JSONDecodeError("Expecting value", s, err.value) from None
JSONDecodeError: Unterminated string starting at: line 759 column 17 (char 25323)
I've tried to decompose the problem and used the next:
import subprocess
import json
subproc = subprocess.run(["pdal", "--drivers", "--showjson"], capture_output=True).stdout
drivers = json.loads(subproc)
and found that subprocess.run(["pdal", "--drivers", "--showjson"])
completed with an error returncode CompletedProcess(args=['pdal', '--drivers', '--showjson'], returncode=3221226505)
and .stdout of this subprocess gets incompleted .json file (the code below is tail-6 of subprocess.run(["pdal", "--drivers", "--showjson"], capture_output=True).stdout
and it's unfinished).
{
"description": "Write data in the Point Cloud Library (PCL) format.",
"extensions": [
"pcd"
],
"link": "http://pda
Did anyone meet such problem?
I had the exact same problem with a conda installation of PDAL 2.2.0 on a pre-existing conda environment (Windows 10, Python 3.9)
Then, as suggested here I reinstalled PDAL on a new dedicated environment with:
and
is now working.
Here is the .yml file content of the environment that was creting the problem in the first place :