pypa/pip · error · IncompleteDownloadError

incomplete-download

incomplete-download

Error message

Download failed {retry_status}because not enough bytes were received ({download_status})

What it means

Error "Download failed {retry_status}because not enough bytes were received ({download_status})" thrown in pypa/pip.

Source

Thrown at src/pip/_internal/network/download.py:273

            try:
                resume_resp = self._http_get_resume(download, should_match=first_resp)
                # Fallback: if the server responded with 200 (i.e., the file has
                # since been modified or range requests are unsupported) or any
                # other unexpected status, restart the download from the beginning.
                must_restart = resume_resp.status_code != HTTPStatus.PARTIAL_CONTENT
                if must_restart:
                    download.reset_file()
                    download.size = _get_http_response_size(resume_resp)
                    first_resp = resume_resp
                else:
                    # If the resume request starts at the wrong location, fail
                    # outright since the server is misbehaving.
                    content_range = resume_resp.headers.get("Content-Range", "")
                    resumed_at = content_range.lower().partition("bytes ")[2]
                    resumed_at = resumed_at.partition("-")[0]
                    if resumed_at and resumed_at != str(download.bytes_received):
                        raise IncompleteDownloadError(download)

                self._process_response(download, resume_resp)
            except (
                ConnectionFailedError,
                ConnectionTimeoutError,
                ProxyConnectionError,
                SSLVerificationError,
                ReadTimeoutError,
                ProtocolError,
                OSError,
            ):
                # The error handling here is tricky, a few notes:
                #
                # - The diagnostic connection errors are raised by our custom
                #   requests.request() connection exception handler.
                # - ProtocolError is raised by urllib3 when the returned data length
                #   doesn't match the response Content-Length.
                # - ReadTimeoutError / ProtocolError come straight from urllib3 (via

View on GitHub (pinned to d7d0d0a394)

When it happens

Trigger: Thrown at src/pip/_internal/network/download.py:273 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pypa/pip@d7d0d0a394 (2026-08-04). Data as JSON: /data/errors/a9bff1440165fbed.json. Report an issue: GitHub.