Jump to solution
Verify

The Fix

pip install stripe==14.4.0a2

Based on closed stripe/stripe-python issue #1035 · PR/commit linked

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -32,7 +32,7 @@ install_requires=[ 'typing_extensions <= 4.2.0, > 3.7.2; python_version < "3.7"', - 'typing_extensions > 3.7.2; python_version >= "3.7"', + 'typing_extensions >= 4.0.0; python_version >= "3.7"', 'requests >= 2.20; python_version >= "3.0"',
repro.py
python3 -m venv venv source venv/bin/activate pip install typing-extensions==3.10.0.2 # any version that satisfies the requirement, but is below 4.0.0 pip install stripe python -m stripe # or any other way to import stripe
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install stripe==14.4.0a2\nWhen NOT to use: This fix is not applicable if the project requires compatibility with Python versions below 3.7.\n\n

Why This Fix Works in Production

  • Trigger: from stripe.api_resources import * # pyright: ignore # noqa
  • Mechanism: Updated the requirement for typing_extensions to be >= 4.0.0 to resolve ImportError related to 'Self'.
  • Why the fix works: Updated the requirement for typing_extensions to be >= 4.0.0 to resolve ImportError related to 'Self'. (first fixed release: 14.4.0a2).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Shows up under Python 3.10 in real deployments (not just unit tests).
  • Surfaces as: Traceback (most recent call last):

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Hi @gkreitz, thanks for bringing this issue to our attention. I've updated the requirement in https://github.com/stripe/stripe-python/pull/1042 and released in v6.3.0.”
@anniel-stripe · 2023-09-05 · confirmation · source

Failure Signature (Search String)

  • from stripe.api_resources import * # pyright: ignore # noqa

Error Message

Stack trace
error.txt
Error Message ------------- Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/gkreitz/foo/venv/lib/python3.10/site-packages/stripe/__init__.py", line 37, in <module> from stripe.api_resources import * # pyright: ignore # noqa File "/home/gkreitz/foo/venv/lib/python3.10/site-packages/stripe/api_resources/__init__.py", line 7, in <module> from . import abstract File "/home/gkreitz/foo/venv/lib/python3.10/site-packages/stripe/api_resources/abstract/__init__.py", line 19, in <module> from stripe.api_resources.abstract.listable_api_resource import ( File "/home/gkreitz/foo/venv/lib/python3.10/site-packages/stripe/api_resources/abstract/listable_api_resource.py", line 4, in <module> from stripe.api_resources.list_object import ListObject File "/home/gkreitz/foo/venv/lib/python3.10/site-packages/stripe/api_resources/list_object.py", line 2, in <module> from typing_extensions import Self ImportError: cannot import name 'Self' from 'typing_extensions' (/home/gkreitz/foo/venv/lib/python3.10/site-packages/typing_extensions.py)

Minimal Reproduction

repro.py
python3 -m venv venv source venv/bin/activate pip install typing-extensions==3.10.0.2 # any version that satisfies the requirement, but is below 4.0.0 pip install stripe python -m stripe # or any other way to import stripe

Environment

  • Python: 3.10

What Broke

Importing stripe fails with ImportError when using an older version of typing-extensions.

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install stripe==14.4.0a2

When NOT to use: This fix is not applicable if the project requires compatibility with Python versions below 3.7.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/stripe/stripe-python/pull/1042

First fixed release: 14.4.0a2

Last verified: 2026-02-08. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if the project requires compatibility with Python versions below 3.7.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
14.4.0a2 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.