-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python][C++] ArrowKeyError: Attempted to register factory for scheme 'file'
when using pip-installed GDAL
#44696
Comments
ArrowKeyError: Attempted to register factory for scheme 'file'
when using pip-installed GDALArrowKeyError: Attempted to register factory for scheme 'file'
when using pip-installed GDAL
Thanks for raising this. It seems like we are registering on the |
This is probably due to conflicting versions of libarrow in the same process (one from brew's gdal and one from conda's pyarrow). Each libarrow is registering different factories for the Having multiple versions of libarrow in play seems like something we'd want to avoid in any case; more subtle errors could arise than this KeyError with filesystem registration. Maybe we should try to assert this at runtime? |
Thanks for your response. I am a bit puzzled because in the steps to produce the errors I am not installing anything with I have $ conda list ─╯
# packages in environment at /opt/homebrew/Caskroom/miniconda/base/envs/test-arrow:
#
# Name Version Build Channel
bzip2 1.0.8 h99b78c6_7 conda-forge
ca-certificates 2024.8.30 hf0a4a13_0 conda-forge
gdal 3.9.2 pypi_0 pypi
libexpat 2.6.4 h286801f_0 conda-forge
libffi 3.4.2 h3422bc3_5 conda-forge
libsqlite 3.47.0 hbaaea75_1 conda-forge
libzlib 1.3.1 h8359307_2 conda-forge
ncurses 6.5 h7bae524_1 conda-forge
openssl 3.4.0 h39f12f2_0 conda-forge
pip 24.3.1 pyh8b19718_0 conda-forge
pyarrow 18.0.0 pypi_0 pypi
python 3.12.7 h739c21a_0_cpython conda-forge
readline 8.2 h92ec313_1 conda-forge
setuptools 75.3.0 pyhd8ed1ab_0 conda-forge
tk 8.6.13 h5083fa2_1 conda-forge
tzdata 2024b hc8b5060_0 conda-forge
wheel 0.45.0 pyhd8ed1ab_0 conda-forge
xz 5.2.6 h57fd34a_0 conda-forge |
If you're using conda, that will put Brew is configurable. IIUC the default is I expect you will see libarrow in both of those places in your error case On Linux you can see which dynamic libraries are loaded at runtime with
... but I don't know what the equivalent for macOS would be |
I think in your case you're getting a statically-linked Arrow (via pyarrow, since it looks like it was installed from pypi) and a dynamically-linked Arrow (via pip install gdal, which I believe builds against your homebrew Arrow). I am wondering if that error would also occur if the versions were identical because of the static/dynamic mismatch. Also possibly related: OSGeo/gdal#10539 |
The basic question: Is it possible to install pyarrow in a way that doesn't include libarrow as a static bundle or otherwise tell it to use a system installed one? Background: I am on a mac and using R & RStudio. Our R code uses many packages that use gdal and on Mac the natural way to get that is to use homebrew install which also installs the homebrew package I can workaround it in a number of ways:
But given that libarrow installed as part of pyarrow on disk is already 50MB and I have another one installed in the homebrew setup (same version even!) it would be nice to just have one installed. |
Describe the bug, including details regarding any error messages, version, and platform.
As always, let me preface this with a thanks for this project and the help the
arrow
developers are giving to the community (which I have benefited from before).Description
I've been tracking a more-than-likely install related bug. Here is a minimal reproducer
and if I run it
Note that if I do not
import osgeo
there is no error.Reproduce
The steps from scratch are the following
conda create -n test-arrow python=3.12 conda activate test-arrow pip install pyarrow 'gdal==3.9.2'
Probably relevant is the fact that I have
gdal
libraries installed with homebrew (on MacOS)Workaround
Everything works if I
conda install gdal
instead of usingpip
(presumably, this also install the libraries and does not use thehomebrew
-installed gdal).Component(s)
Python
The text was updated successfully, but these errors were encountered: