manaakiwhenua / vector2dggs

DGGS indexer for vector data
https://pypi.org/project/vector2dggs/
GNU Lesser General Public License v3.0
6 stars 0 forks source link

Pip & Poetry install failing #27

Open SPlanzer opened 1 month ago

SPlanzer commented 1 month ago

Pip and Poetry install failure

pip install is failing (Ubuntu with a new Conda environment)

The below collapsible section has the details of the failed install. Looks to be related to compiling of the Cython code with pygeos

Installation Log: pip install vector2dggs ```plaintext pip install vector2dggs Collecting vector2dggs Using cached vector2dggs-0.6.0-py3-none-any.whl.metadata (9.8 kB) Collecting click<9.0.0,>=8.1.3 (from vector2dggs) Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB) Collecting click-log<0.5.0,>=0.4.0 (from vector2dggs) Using cached click_log-0.4.0-py2.py3-none-any.whl.metadata (1.2 kB) Collecting dask<2024.0.0,>=2023.3.0 (from vector2dggs) Using cached dask-2023.12.1-py3-none-any.whl.metadata (3.7 kB) Collecting dask-geopandas<0.4.0,>=0.3.0 (from vector2dggs) Using cached dask_geopandas-0.3.1-py3-none-any.whl.metadata (3.6 kB) Collecting gdal<4.0.0,>=3.8.0 (from vector2dggs) Using cached gdal-3.9.1.tar.gz (840 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting geopandas<0.13.0,>=0.12.2 (from vector2dggs) Using cached geopandas-0.12.2-py3-none-any.whl.metadata (1.0 kB) Collecting h3pandas<0.3.0,>=0.2.6 (from vector2dggs) Using cached h3pandas-0.2.6-py3-none-any.whl Collecting psycopg2<3.0.0,>=2.9.6 (from vector2dggs) Using cached psycopg2-2.9.9-cp312-cp312-linux_x86_64.whl Collecting pyarrow<15.0.0,>=14.0.1 (from vector2dggs) Using cached pyarrow-14.0.2-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (3.0 kB) Collecting pygeos<0.14,>=0.13 (from vector2dggs) Using cached pygeos-0.13.tar.gz (141 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [59 lines of output] :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html /tmp/pip-install-d4puysb_/pygeos_02aeec6a98274d01907dec1df753d816/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Error compiling Cython file: ------------------------------------------------------------ ... self.last_error = malloc((1025) * sizeof(char)) self.last_error[0] = 0 self.last_warning = malloc((1025) * sizeof(char)) self.last_warning[0] = 0 GEOSContext_setErrorMessageHandler_r( self.handle, &geos_message_handler, self.last_error ^ ------------------------------------------------------------ pygeos/_geos.pyx:30:25: Cannot assign type 'void (*)(const char *, void *) except *' to 'GEOSMessageHandler_r' (alias of 'void (*)(const char *, void *) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned. Error compiling Cython file: ------------------------------------------------------------ ... self.last_warning[0] = 0 GEOSContext_setErrorMessageHandler_r( self.handle, &geos_message_handler, self.last error ) GEOSContext_setNoticeMessageHandler_r( self.handle, &geos_message_handler, self last_warning ^ ------------------------------------------------------------ pygeos/_geos.pyx:33:25: Cannot assign type 'void (*)(const char *, void *) except *' to 'GEOSMessageHandler_r' (alias of 'void (*)(const char *, void *) noexcept'). Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned. Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-i_ujwu4p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-i_ujwu4p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-i_ujwu4p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup super().run_setup(setup_script=setup_script) File "/tmp/pip-build-env-i_ujwu4p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 195, in File "/tmp/pip-build-env-i_ujwu4p/overlay/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize cythonize_one(*args) File "/tmp/pip-build-env-i_ujwu4p/overlay/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: pygeos/_geos.pyx [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel 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. ```

poetry install returns similar results

Installation Log: poetry install vector2dggs ```plaintext - Installing pygeos (0.14): Failed ChefBuildError Backend subprocess exited when trying to invoke get_requires_for_build_wheel :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html /tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main() File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 214, in File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 342, in get_config_from_root parser = configparser.SafeConfigParser() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did - Installing h3pandas (0.2.6) - Installing psycopg2 (2.9.9) - Installing pyarrow (14.0.2) - Installing pygeos (0.14): Failed ChefBuildError Backend subprocess exited when trying to invoke get_requires_for_build_wheel :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html /tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main() File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 214, in File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 342, in get_config_from_root parser = configparser.SafeConfigParser() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did - Installing gdal (3.9.1): Installing... - Installing h3pandas (0.2.6) - Installing psycopg2 (2.9.9) - Installing pyarrow (14.0.2) - Installing pygeos (0.14): Failed ChefBuildError Backend subprocess exited when trying to invoke get_requires_for_build_wheel :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html /tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main() File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 214, in File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 342, in get_config_from_root parser = configparser.SafeConfigParser() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did - Installing h3pandas (0.2.6) - Installing psycopg2 (2.9.9) - Installing pyarrow (14.0.2) - Installing pygeos (0.14): Failed ChefBuildError Backend subprocess exited when trying to invoke get_requires_for_build_wheel :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html /tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main() File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 214, in File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 342, in get_config_from_root parser = configparser.SafeConfigParser() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did - Installing gdal (3.9.1) - Installing h3pandas (0.2.6) - Installing psycopg2 (2.9.9) - Installing pyarrow (14.0.2) - Installing pygeos (0.14): Failed ChefBuildError Backend subprocess exited when trying to invoke get_requires_for_build_wheel :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html /tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main() File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/planzers/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires self.run_setup() File "/tmp/tmpor05rulu/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup exec(code, locals()) File "", line 214, in File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmp8tfyojhh/pygeos-0.14/versioneer.py", line 342, in get_config_from_root parser = configparser.SafeConfigParser() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'? at ~/miniconda3/envs/test_v2dggs/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare 160│ 161│ error = ChefBuildError("\n\n".join(message_parts)) 162│ 163│ if error is not None: → 164│ raise error from None 165│ 166│ return path 167│ 168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path: Note: This error originates from the build backend, and is likely not a problem with poetry but with pygeos (0.14) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "pygeos (==0.14)"'. - Installing pytest (7.4.4) ```

For Now

I was successful in install this with the below

git clone git@github.com:manaakiwhenua/vector2dggs.git
cd vector2dggs
mamba create -n vector2dggs python=3.11
mamba install gdal geopandas h3pandas dask-geopandas dask click tqdm click-log pyarrow pygeos pyproj sqlalchemy psycopg2
pip install -e .
alpha-beta-soup commented 1 month ago

I can't even get your workaround to work.

What I have been using is a conda environment file (which still uses pip to install vector2dggs):

name: vector2dggs
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.11
  - pip
  - gdal=3.9.1
  - pip:
    - vector2dggs>=0.5.4

If you save this to env.yml and run conda env create --name v2d --file env.yml... well, it still fails. (However, it definitely has worked in the past.)

However here's my new workaround:

conda create --name v2d python=3.11 gdal=3.9.1 -c conda-forge
pip install vector2dggs==0.5.4

Installing 0.6.0 (current release) does not work even with this method. This is probably due to an upgrade in the gdal dependency introduced in https://github.com/manaakiwhenua/vector2dggs/commit/c61b7dbf0a3ab9bfc8ae0e80c391e79263dbbc65

Since it seems to matter, my system has libgeos-dev on Ubuntu 22.04 LTS at 3.12.1-1.

alpha-beta-soup commented 1 month ago
name: vector2dggs
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.11
  - pip
  - gdal=3.9.1
  - pip:
    - vector2dggs==0.5.4

Works. So this is ultimately associated with upgrading the python GDAL dependency; perhaps some conflict with system-installed GEOS. I'll see if we even need the upgrade to GDAL for v0.6; I don't think it's necesssary.

alpha-beta-soup commented 1 month ago

With latest release (0.6.1) I can now do a bare pip install vector2dggs successfully.

@SPlanzer if you can do this too, please close the issue.