geopandas / pyogrio

Vectorized vector I/O using OGR
https://pyogrio.readthedocs.io
MIT License
257 stars 21 forks source link

python 3.12 support #416

Closed sikmir closed 3 weeks ago

sikmir commented 1 month ago

Python 3.12 removed distutils after it being deprecated since Python 3.10. See https://docs.python.org/3/whatsnew/3.12.html#distutils

python3.12-pyogrio> Traceback (most recent call last):
python3.12-pyogrio>   File "/private/tmp/nix-build-python3.12-pyogrio-0.8.0.drv-0/source/setup.py", line 8, in <module>
python3.12-pyogrio>     from distutils import log
python3.12-pyogrio> ModuleNotFoundError: No module named 'distutils'
jorisvandenbossche commented 1 month ago

We should definitely clean that up, but it's also strange this is giving problems for you (we test Python 3.12 on CI). What version of setuptools do you have installed in that environment? (potentially an older version of setuptools might not install distutils as well)

sikmir commented 1 month ago

Replacing distutils with setuptools._distutils solves the problem for me. setuptools 69.5.1

jorisvandenbossche commented 1 month ago

How is your setuptools installed? Normally installing setuptools also ensures there is an importable distutils (which points to setuptools._distutils)

sikmir commented 1 month ago

How is your setuptools installed?

I use nix package https://github.com/NixOS/nixpkgs/blob/e178126c3ab15b0bfc300fb6cc8c58ea9f49c0d6/pkgs/development/python-modules/pyogrio/default.nix