python-poetry/poetry · error · PackageNotFoundError
Package [{name}] not found.
Error message
Package [{name}] not found. What it means
Raised by SinglePageRepository._get_page when the single listing page returns no response (single_page_repository.py:19-21). A single-page repository serves all packages from one HTML page; if _get_response("") returns None (404/401/403) the repository is unusable and this fires. Inherits from LegacyRepository so it shares the HTTP not-found/auth ambiguity of error 85.
Source
Thrown at src/poetry/repositories/single_page_repository.py:21
from typing import TYPE_CHECKING
from poetry.repositories.exceptions import PackageNotFoundError
from poetry.repositories.legacy_repository import LegacyRepository
from poetry.repositories.link_sources.html import HTMLPage
if TYPE_CHECKING:
from packaging.utils import NormalizedName
class SinglePageRepository(LegacyRepository):
def _get_page(self, name: NormalizedName) -> HTMLPage:
"""
Single page repositories only have one page irrespective of endpoint.
"""
response = self._get_response("")
if not response:
raise PackageNotFoundError(f"Package [{name}] not found.")
return HTMLPage(response.url, response.text)
View on GitHub (pinned to 92b74dcfe3)
Solutions
- Verify the single-page URL is correct and returns an HTML listing in a browser.
- Configure auth if the server returns 401/403.
- Use a multi-page (Legacy) repository instead if the server is a standard simple index.
Defensive patterns
Strategy: validation
Validate before calling
resp = repo._get_response("")
if resp is None:
raise ConnectionError(
f"single-page repository {repo.name} unreachable; check URL and auth"
) Try / catch
from poetry.repositories.exceptions import PackageNotFoundError
try:
page = repo._get_page(name)
except PackageNotFoundError:
log.error("single-page index %s unavailable or needs auth", repo.name)
raise Prevention
- Verify the single-page URL returns a valid HTML listing.
- Configure auth if the artifact server is protected.
- Prefer a standard multi-page simple index when possible.
When it happens
Trigger: Any package lookup on a SinglePageRepository when the base URL is unreachable, returns 404, or requires missing auth (response None).
Common situations: Wrong single-page URL configured; the static page was moved/deleted; auth credentials not supplied for a protected artifact server.
Related errors
- Package [{name}] not found.
- No valid distribution links found for package: "{data.name}"
- Package {name} ({version}) not found.
- Expected one or two arguments (username, password), got {len
- Expected only one argument (token), got {len(values)}
AI-assisted analysis of python-poetry/poetry@92b74dcfe3 (2026-08-04).
Data as JSON: /data/errors/1c477c298cf0c242.json.
Report an issue: GitHub.