Skip to content

Clean install fails to import on Python 3.13+/3.14: typing_extensions is used but never declared #690

Description

@joerg84

Repro

python3.14 -m venv v && v/bin/pip install pinecone==9.1.0
v/bin/python -c "import pinecone; from pinecone import Pinecone; pinecone.Pinecone"
# ModuleNotFoundError: No module named 'typing_extensions'
# (raised from pinecone/__init__.py __getattr__ -> importlib.import_module)

Also reproduces on a clean Python 3.13 environment.

Root cause

pinecone/_internal/indexes_helpers.py does:

from typing_extensions import NotRequired

but typing_extensions is not in [project] dependencies (only httpx[http2], msgspec, orjson).

It has been working by accident:

  • httpx → anyio declares typing_extensions; python_version < "3.13", so on ≤3.12 the module is present transitively. On 3.13+ that marker no longer applies and clean installs break at import time.
  • Dev/CI environments always have it via mypy, and the unit-test matrix in on-push.yml caps at 3.13 — so neither local dev nor CI could see it.

Proposed fix

NotRequired is in stdlib typing since 3.11 and requires-python is >=3.10, so:

  1. Version-gate the import (typing on 3.11+, typing_extensions on 3.10).
  2. Declare the real dependency for the remaining case: typing_extensions; python_version < "3.11".
  3. Add 3.14 to the unit-test matrix, and/or a bare-venv "install wheel, import pinecone" smoke on the newest Python, so undeclared imports can't hide behind dev dependencies again.

How we found it

Cold-agent audit for an upcoming blog post: agents in a bare environment installing pinecone from PyPI on Python 3.14 hit this on their first import in 2 of 2 SDK-path trials (they recovered by pip install typing_extensions, which a human user may not think to do).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions