Toblerity / Fiona

Fiona reads and writes geographic data files
https://fiona.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.14k stars 201 forks source link

Pip package fiona-1.9.6.tar.gz has inconsistent version: filename has '1.9.6', but metadata has '0.0.0' #1393

Closed luiscamachopt closed 2 months ago

luiscamachopt commented 2 months ago

Hi

Expected behavior and actual behavior.

Expected: to able to specify a range of versions when install fiona with pip. Actual: get warning and error from pip

WARNING: Requested fiona<2,>=1.9.6 from https://files.pythonhosted.org/packages/92/2c/2ab81e38aad8cf4f4e2a7b1c0488750ffc512c108fb244a8b4dd4f196cd3/fiona-1.9.6.tar.gz#sha256=791b3494f8b218c06ea56f892bd6ba893dfa23525347761d066fb7738acda3b1, but installing version 0.0.0
Discarding https://files.pythonhosted.org/packages/92/2c/2ab81e38aad8cf4f4e2a7b1c0488750ffc512c108fb244a8b4dd4f196cd3/fiona-1.9.6.tar.gz#sha256=791b3494f8b218c06ea56f892bd6ba893dfa23525347761d066fb7738acda3b1 (from https://pypi.org/simple/fiona/) (requires-python:>=3.7): Requested fiona<2,>=1.9.6 from https://files.pythonhosted.org/packages/92/2c/2ab81e38aad8cf4f4e2a7b1c0488750ffc512c108fb244a8b4dd4f196cd3/fiona-1.9.6.tar.gz#sha256=791b3494f8b218c06ea56f892bd6ba893dfa23525347761d066fb7738acda3b1 has inconsistent version: filename has '1.9.6', but metadata has '0.0.0'
ERROR: Could not find a version that satisfies the requirement fiona<2,>=1.9.6 (from versions: 0.5, 0.6, 0.6.1, 0.6.2, 0.7, 0.8, 0.9, 0.9.1, 0.10, 0.12, 0.12.1, 0.13, 0.14, 0.15, 0.16, 0.16.1, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.3.post1, 1.6.4, 1.7.0, 1.7.0.post2, 1.7.1, 1.7.1.post1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.9.post1, 1.7.10, 1.7.10.post1, 1.7.11, 1.7.11.post1, 1.7.11.post2, 1.7.12, 1.7.13, 1.8b1, 1.8b2, 1.8rc1, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.9.post1, 1.8.9.post2, 1.8.10, 1.8.11, 1.8.12, 1.8.13, 1.8.13.post1, 1.8.14, 1.8.15, 1.8.16, 1.8.17, 1.8.18, 1.8.19, 1.8.20, 1.8.21, 1.8.22, 1.9a1, 1.9a2, 1.9a3, 1.9b1, 1.9b2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.4.post1, 1.9.5, 1.9.6, 1.10a1, 1.10a2, 1.10b1)
ERROR: No matching distribution found for fiona<2,>=1.9.6

Steps to reproduce the problem.

Install fiona with pip install "fiona>=1.9.6,<2"

Operating system

container image: osgeo/gdal:ubuntu-small-3.6.2

Thank you

mwtoews commented 2 months ago

The cause of "metadata has '0.0.0'" is that setuptools need to have version 61 or later (docs) to read metadata to build fiona-1.9.x. Looking at that docker image the setuptools version was too old to fetch the appropriate metadata.

Here is what works for me:

apt update
apt install -y cython3 python3-pip python3-numpy
pip install --upgrade setuptools
pip install --upgrade --force-reinstall --no-build-isolation --no-binary fiona "fiona>=1.9.6,<2"
sgillies commented 2 months ago

@mwtoews thank you for the answer!

luiscamachopt commented 2 months ago

@mwtoews thank you!