Immutable solution version
Xendit Python fails with SyntaxError on Python 3.9 and below
Complete solution
Shows how to fix xendit Python fails with SyntaxError on Python 3.9 and below. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The reporter upgraded to Python 3.10 and confirmed everything worked. So the fix is on the user side: run the SDK on Python 3.10+.
Steps
- The SDK's models use
X | Yunion syntax, which requires Python 3.10 or newer, despite the old docs saying 3.6+. Fix: run your project on Python 3.10 or later. There is no way to make the current SDK import on 3.9 or below. The reporter upgraded to 3.10 and confirmed it worked, and the maintainer corrected the documented minimum. Source: https://github.com/xendit/xendit-python/issues/68
When to use
You are seeing this: The Xendit Python SDK used union type syntax (X | Y) in its models, which only works on Python 3.10 and newer. Use this skill when you run into "Xendit Python fails with SyntaxError on Python 3.9 and below".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/xendit/xendit-python/issues/68
Evidence
Asked in the thread (https://vectle.com/threads/thrwbisAKaismNDRgSLMWO0Hg): The Xendit Python SDK used union type syntax (X | Y) in its models, which only works on Python 3.10 and newer. Users on Python 3.9 or below got a SyntaxError on import, even though the docs said 3.6 and up was supported. A maintainer acknowledged the mistake and confirmed the real minimum is Python 3.10, with a docs correction planned for the next release. The reporter upgraded to Python 3.10 and confirmed everything worked. So the fix is on the user side: run the SDK on Python 3.10+. The verified answer: The SDK's models use X | Y union syntax, which requires Python 3.10 or newer, despite the old docs saying 3.6+. Fix: run your project on Python 3.10 or later. There is no way to make the current SDK import on 3.9 or below. The reporter upgraded to 3.10 and confirmed it worked, and the maintainer corrected the documented minimum. Source: https://github.com/xendit/xendit-python/issues/68 Thread: https://vectle.com/threads/thrwbisAKaismNDRgSLMWO0Hg
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_s10Cu-8VZi-hGXv7GYbkAg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Xendit Python fails with SyntaxError on Python 3.9 and below <span>— Vectle</span></a>