Open nein25 opened 1 year ago
I believe "D:/bld/pdal_1678484181627/_h_env/Library/bin"
is the path that is used on the @conda-forge builder.
What does conda list
show for you?
Strange... the channel listed beside pdal is pypi, not conda-forge.
please try installing from python-pdal
and see if you still have issues.
Even so, I do not understand where this error is coming from.
Could you clarify 'installing from python-pdal' please? Thank you
conda install -c conda-forge python-pdal
instead of pip install PDAL
. Do this in a fresh environment.
It still lists pypi as the channel beside PDAL. I did create a new environment for testing.
This may not be pertinent, but it's very likely I downloaded PDAL via PIP a year or more ago before I knew anything about Conda.
It still lists pypi as the channel beside PDAL
confirmed I'm seeing this on a fresh environment too. I do not get the weakly_canonical error when I import pdal
however
I think the issue is conda is confused:
pdal
is the name of the base PDAL library/utilitiespython-pdal
is the name of the PDAL Python extension for CondaPDAL
is the name of the PDAL Python extension on PyPII'm not quite sure what to do here. Any ideas @chambbj ?
I just tried a couple of things, maybe helpful to know - maybe not!
In the Conda prompt, for both my fresh test environment (pdal_test), and the existing one (pdalpython) - I am able to import pdal without issue. When I open Spyder via conda prompt for the pdalpython environment, and import pdal through the console, I get the error message. This is also true with PyCharm and VSCode. Perhaps an issue with my IDE settings?
there have been a number of tickets related to Spyder.
The path that is being checked there must be related to not having a PDAL_DRIVER_PATH
environment variable set.
Try setting PDAL_DRIVER_PATH=%CONDA_PREFIX\Library\bin
in your Spyder environment and see if the import succeeds.
That did the trick! I was able to import pdal without issue in Spyder. Thanks so much for the help.
EDIT: I did figure out how to update the path in Spyder preferences.
The cause of the issue is PDAL_DRIVER_PATH
is set by the Conda Forge recipe when PDAL is configured, and it is embedded as a default lookup directory into the DLL when it is built. In Conda's case, this is the DLL directory relevant to where/how it is being built as a package.
The straight Conda package activate/deactivate scripts take care of handling PDAL_DRIVER_PATH
so we never see the error of it trying its default directory that doesn't exist (because it was set to the CONDA_PREFIX of the builder machine that compiled the package, not where it was deployed).
PDAL could certainly not try to list directories that don't exist, and that issue is https://github.com/PDAL/PDAL/issues/4005
This rest of it is an issue that should be handled in the Conda package, but I'm not sure how to do it. https://github.com/conda-forge/python-pdal-feedstock/ is where the conda package is managed.
Any updates on fixing this issue? I'm getting the same 'RuntimeError: weakly_canonical" error in a fresh Anaconda installation, python 3.11.1 and using a fresh environment? I've tried uninstalling and reinstalling everything multiple times without success.
I installed the python-pdal package with command conda install -c conda-forge python-pdal
followed by conda update python-pdal
I've installed PDAL using miniconda via "conda install -c conda-forge pdal python-pdal gdal". I was able to use PDAL in conda prompt successfully. When trying to run a standalone script in either PyCharm or Spyder, I receive the following error message:
E:\dev\tiff_to_las\data>"C:\Users\alex\AppData\Local\miniconda3\envs\pdalpython\python.exe" "E:\dev\tiff_to_las\pdal_tiff_to_las.py" Traceback (most recent call last): File "E:\dev\tiff_to_las\pdal_tiff_to_las.py", line 8, in
import pdal
File "C:\Users\alex\AppData\Local\miniconda3\envs\pdalpython\Lib\site-packages\pdal__init__.py", line 8, in
inject_pdal_drivers()
File "C:\Users\alex\AppData\Local\miniconda3\envs\pdalpython\Lib\site-packages\pdal\drivers.py", line 66, in inject_pdal_drivers
drivers = libpdalpython.getDrivers()
^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: weakly_canonical: The device is not ready.: "D:/bld/pdal_1678484181627/_h_env/Library/bin"
E:\dev\tiff_to_las\data>pause Press any key to continue . . .
My machine has a D:/, but it's a DVD RW Drive that is never used. I have tried removing OSGeo4W, which had PDAL. I have tried removing and recreating the PDAL environment in miniconda, and the error persists. Apologies if this is a duplicate, I did a bit of searching to find a similar issue and wasn't able to find any. Thanks a bunch for any help.