7 months ago
error: packages/setuptools/command/egg_info.py", line 312, in run self.find_sources() File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 320, in find_sources mm.run() File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 543, in run self.add_defaults() File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 581, in add_defaults sdist.add_defaults(self) File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/command/sdist.py", line 109, in add_defaults super().add_defaults() File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 245, in add_defaults self._add_defaults_ext() File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 329, in adddefaults_ext build_ext = self.get_finalized_command('build_ext') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 334, in get_finalized_command cmd_obj.ensure_finalized() File "/tmp/pip-build-env-oj6qy6kv/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 135, in ensure_finalized self.finalize_options() File "<string>", line 255, in finalize_options File "<string>", line 194, in get_gdal_config gdal_config_error: Traceback (most recent call last): File "<string>", line 87, in fetch_config File "/root/.nix-profile/lib/python3.12/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/root/.nix-profile/lib/python3.12/subprocess.py", line 1955, in executechild raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'gdal-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 188, in get_gdal_config File "<string>", line 90, in fetch_config gdal_config_error: [Errno 2] No such file or directory: 'gdal-config' Could not find gdal-config. Make sure you have installed the GDAL native library and development headers. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip.
Jul 04 03:56:22
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.
Jul 04 03:56:22
✕ [stage-0 6/8] RUN --mount=type=cache,id=s/36c1bc9e-53a4-4aea-82c7-625e9605f169-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt
process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1
Jul 04 03:56:22
Dockerfile:20
Jul 04 03:56:22
-------------------
Jul 04 03:56:22
18 | ENV NIXPACKS_PATH=/opt/venv/bin:$NIXPACKS_PATH
Jul 04 03:56:22
19 | COPY . /app/.
Jul 04 03:56:22
20 | >>> RUN --mount=type=cache,id=s/36c1bc9e-53a4-4aea-82c7-625e9605f169-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt
Jul 04 03:56:22
21 |
Jul 04 03:56:22
22 |
Jul 04 03:56:22
-------------------
Jul 04 03:56:22
ERROR: failed to build: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1
Jul 04 03:56:22
Error: Docker build failed
2 Replies
7 months ago
The error arises during the pip install step in your Dockerfile when a package (likely GDAL or a dependency like psycopg2) tries to compile from source and cannot find gdal-config. This utility is part of the GDAL development libraries, which are not included in minimal Docker images like python:3.12-slim. Your Dockerfile uses a virtual environment and runs pip install -r requirements.txt, but the base image lacks the system-level dependencies (libgdal-dev, gdal-bin, libpq-dev) needed for PostGIS-related packages. The error is compounded by the fact that the build process is trying to locate gdal-config to determine GDAL's configuration, but it’s not installed. you can use psycopg2-binary instead of psycopg2, also add versions of each libraries in requirement.txt,
6 months ago
this is not working. Thanks