Skip to content
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

GDAL python bindings not able to install from last week to this week, what happens? #4467

Closed
meteoDaniel opened this issue Sep 10, 2021 · 5 comments

Comments

@meteoDaniel
Copy link

meteoDaniel commented Sep 10, 2021

I am having a Dockerfile:

FROM python:3.9.1-slim
MAINTAINER Daniel Lassahn <daniel.lassahn@meteointelligence.de>

ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux

WORKDIR /tmp
RUN set -ex \
    && buildDeps=' \
        libnetcdf-dev \
        libhdf5-dev \
        build-essential \
        libbz2-dev \
    ' \
    && apt-get update -yqq \
    && apt-get install -yqq --no-install-recommends \
        $buildDeps \
        curl \
        wget \
        gcc \
        make \
    && apt-get remove -y $buildDeps \
    && apt-get autoremove -y

RUN apt-get install -yqq g++ \
        sqlite3 \
        libsqlite3-dev \
        libtiff5-dev \
        pkg-config \
        unzip \
        libgeos-dev \
        apt-transport-https \
        software-properties-common \
        python3-pip

# install gdal
RUN wget https://download.osgeo.org/proj/proj-7.2.0.tar.gz
RUN tar xvzf proj-7.2.0.tar.gz && cd proj-7.2.0 && ./configure --without-curl && make && make install
RUN cd /
RUN wget download.osgeo.org/gdal/3.0.4/gdal304.zip
RUN unzip gdal304.zip && cd gdal-3.0.4 && ./configure && make clean && make && make install
ENV LD_LIBRARY_PATH=/usr/local/lib

RUN apt-get install -yqq python3-opencv
RUN pip3 install --upgrade setuptools wheel pip
RUN pip3 install scikit-build==0.11.1 Cython==0.29.21 numpy==1.20.1
COPY ./requirements.txt /opt/requirements.txt
RUN pip3 install -r /opt/requirements.txt

And requirements.txt:

scipy==1.6.0
netCDF4==1.5.6
pandas==1.2.2
GDAL==3.0.4
opencv-contrib-python==4.5.1.48
imutils==0.5.4
xarray==0.16.2
ffmpeg==1.4
ipython==7.10.1
ipython-genutils==0.2.0

Last week installation was no problem. Today I am receiving the following issue:

   ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-zpdz5hk4/gdal_ed07faecea7d4de28169353daf6e4d71/setup.py'"'"'; __file__='"'"'/tmp/pip-install-zpdz5hk4/gdal_ed07faecea7d4de28169353daf6e4d71/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-ywuqf96f
         cwd: /tmp/pip-install-zpdz5hk4/gdal_ed07faecea7d4de28169353daf6e4d71/
    Complete output (5 lines):
    /usr/local/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_2to3_fixers'
      warnings.warn(msg)
    /usr/local/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'use_2to3_exclude_fixers'
      warnings.warn(msg)
    error in GDAL setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/ae/09/cac5021db34f5c95c6a660b90e5d27062a520fe32a0493f68d07a7055d30/GDAL-3.0.4.tar.gz#sha256=a17eaa6872e4b7f7fa82f86aeccecc57d224bd054952a56db64368ecaf18509c (from https://pypi.org/simple/gdal/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement GDAL==3.0.4 (from versions: 1.5.0, 1.5.2, 1.6.0, 1.6.1, 1.7.0, 1.7.1, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.11.0, 1.11.1, 1.11.2, 2.0.0, 2.0.1, 2.1.0, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.2, 2.4.3, 2.4.4, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.3.0, 3.3.1, 3.3.2)
ERROR: No matching distribution found for GDAL==3.0.4

Message tells me that 3.0.4 is available and not. What to do?

@rouault
Copy link
Member

rouault commented Sep 10, 2021

I'm not sure why you get this error. https://pypi.org/project/GDAL/3.0.4/ is still there and we haven't touch it.

@rouault rouault closed this as completed Sep 10, 2021
@piyushrpt
Copy link
Contributor

You will need to start pinning setuptools to 57.5.0 for gdal 3.0.4 going forward.

@meteoDaniel
Copy link
Author

Thanks @piyushrpt this solved the issue !

@astrojuanlu
Copy link

You will need to start pinning setuptools to 57.5.0 for gdal 3.0.4 going forward.

Any plans to move away from use_2to3?

@rouault
Copy link
Member

rouault commented Dec 15, 2021

Any plans to move away from use_2to3?

It is no longer used since 36b6ccd in GDAL 3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants