-
Hi! I have a question about GDAL binary paths and how Rasterio knows where to look. TL;DR - how and when does rasterio build the rpath to search for the GDAL library, and how do I change it? Context: I want to change the GDAL binary I use on my Mac from one I installed via brew to one I installed via pixi. I have successfully deleted my brew GDAL installation and installed the pixi installation, which puts GDAL into a new path - (FYI, I installed GDAL via pixi using the command I have then tried to reinstall rasterio from scratch, with cache disabled, and with the GDAL_CONFIG variable set: GDAL_CONFIG=/Users/<user>/.pixi/bin/gdal-config python -m pip install --no-binary rasterio rasterio==1.3.7 --no-cache-dir All works well. However, when I try and run anything from rasterio, such as ImportError: dlopen(/Users/<user>/Code/data-eo-libraries/venv/lib/python3.9/site-packages/rasterio/_filepath.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libgdal.32.dylib
Referenced from: <BA5DA7E8-A5AE-3ACE-8B4C-9117B1C4CEC4> /Users/<user>/Code/data-eo-libraries/venv/lib/python3.9/site-packages/rasterio/_filepath.cpython-39-darwin.so
Reason: tried: '/Users/<user>/.pyenv/versions/3.9.19/lib/libgdal.32.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/<user>/.pyenv/versions/3.9.19/lib/libgdal.32.dylib' (no such file), '/opt/homebrew/lib/libgdal.32.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libgdal.32.dylib' (no such file), '/Users/<
8000
;user>/.pyenv/versions/3.9.19/lib/libgdal.32.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/<user>/.pyenv/versions/3.9.19/lib/libgdal.32.dylib' (no such file), '/opt/homebrew/lib/libgdal.32.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libgdal.32.dylib' (no such file) To me, it seems like This brings me to my questions:
Random notes, and things I've tried:
Thank you so much in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey folks, just following up on this question. Happy to clarify what I'm asking if anything is unclear |
Beta Was this translation helpful? Give feedback.
-
@dchirst Your use of GDAL_CONFIG looks correct. I don't have enough experience with pixi or pyenv to help you with any issue involving them. Pixi, being part of the conda ecosystem, could be used to install Rasterio from conda-forge. I strongly recommend using Rasterio 1.4.3. It has a bunch of key bug fixes. |
Beta Was this translation helpful? Give feedback.
@dchirst Your use of GDAL_CONFIG looks correct. I don't have enough experience with pixi or pyenv to help you with any issue involving them. Pixi, being part of the conda ecosystem, could be used to install Rasterio from conda-forge. I strongly recommend using Rasterio 1.4.3. It has a bunch of key bug fixes.