PDAL / python

PDAL's Python Support
Other
115 stars 34 forks source link

DLL load failed while importing libpdalpython #144

Closed Kurtaja closed 1 year ago

Kurtaja commented 1 year ago

Hi, I'm getting this error "DLL load failed while importing libpdalpython: The specified module could not be found." when the python execution encounters the "import pdal" command. I'm using a Python 3.9 (64-bit) environment on windows 11 (I'm not running on conda but through a Flask project in Visual Studio). The virtual environment is an all fresh conda env and only have 'pdal' (installed with the "conda install -c conda-forge python-pdal" command), 'Pybind11', 'Numpy' and 'scikit-build' installed. The pdal version is (3.2.2), though I have tried all the older versions, all giving the same error. The environment is installed in my 'C:\pyvirtuals\conda\' folder, and I have tried to add the 'C:\pyvirtuals\conda\Python_3_9_conda_pdal_env\Lib\site-packages\pdal' folder to the 'sys.path', because I see that the 'libpdalpython.cp39-win_amd64.pyd' is located there. But that does not help either. Greatly appreciated if anybody have an idea what I should do to resolve this. PS: I'm getting the same error, no matter if I run from my Flask project in Visual Studio or if I launch a coda command prompt activate the venv, start python from the conda command prompt and then type "import pdal". Kind regards Kurt

Maerecque commented 1 year ago

Hi, I am also experiencing the same issue. I am not even using Conda, but am in the same situation as Kurt. I am using Python 3.9 (64-bit), but I am on Windows 10. I have also tried uninstalling and reinstalling the library (just like Kurt also all of the older versions of the library). If there is a way to solve this issue, I'd be very glad to hear it. Thanks in advance. With kind regards, Maerecque

hobu commented 1 year ago

Please try with the latest release and report back. 3.2.3 should hopefully resolve this issue (wheels were accidentally getting pushed up to PyPI).

1kaiser commented 1 year ago

!python -m pip install pdal

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting pdal
  Downloading pdal-3.2.3.tar.gz (246 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 246.7/246.7 KB 7.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from pdal) (1.22.4)
Building wheels for collected packages: pdal
  error: subprocess-exited-with-error

  × Building wheel for pdal (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for pdal (pyproject.toml) ... error
  ERROR: Failed building wheel for pdal
Failed to build pdal
ERROR: Could not build wheels for pdal, which is required to install pyproject.toml-based projects
1kaiser commented 1 year ago

and the colab version erros to

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
[<ipython-input-4-3ef3d679e24d>](https://localhost:8080/#) in <cell line: 1>()
----> 1 import pdal

1 frames
[/usr/local/lib/python3.9/site-packages/pdal/__init__.py](https://localhost:8080/#) in <module>
      6 from .pipeline import Filter, Pipeline, Reader, Stage, Writer
      7 
----> 8 inject_pdal_drivers()
      9 dimensions = libpdalpython.getDimensions()
     10 info = libpdalpython.getInfo()

[/usr/local/lib/python3.9/site-packages/pdal/drivers.py](https://localhost:8080/#) in inject_pdal_drivers()
     65 
     66     drivers = libpdalpython.getDrivers()
---> 67     options = libpdalpython.getOptions()
     68 
     69     streamable = []

RuntimeError: readers.e57: 17 : result=-1 fileName= flags=0 mode=0
hobu commented 1 year ago

You must have the PDAL cpp library installed. See https://colab.research.google.com/drive/1JQpcVFFJYMrJCfodqP4Nc_B0_w6p5WOV#scrollTo=qiKI1JD9VqIr for an example of how to get Colab to do anything.