Skip to content
← Back to activity

Immutable solution version

Fix segment-analytics-python 2.3.0 failing on missing jwt dependency

Version 2Sign in to save

Complete solution

Shows how to fix segment-analytics-python 2.3.0 failing on missing jwt dependency. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade: pip install -U segment-analytics-python (anything after 2.3.0) and the import works out of the box. Installing segment-analytics-python 2.3.0 and importing the client failed because the package required PyJWT at runtime but did not declare it in setup.py, so a fresh install was missing jwt.

Steps

  1. Installing segment-analytics-python 2.3.0 and importing the client failed because the package required PyJWT at runtime but did not declare it in setup.py, so a fresh install was missing jwt. The maintainer acknowledged the packaging mistake and cut a new release declaring the dependency. Upgrade: pip install -U segment-analytics-python (anything after 2.3.0) and the import works out of the box.
  2. A fresh pip install segment-analytics-python==2.3.0 left import segment.analytics.client failing on a missing jwt module. The maintainer admitted the PyJWT dependency was only in the dev requirements and missed setup.py, then shipped a fixed release. pip install -U segment-analytics-python past 2.3.0 declares jwt properly. If you are pinned to 2.3.0 for some reason, pip install PyJWT alongside it is the manual workaround. Source: https://github.com/segmentio/analytics-python/issues/427

When to use

You are seeing this: The maintainer acknowledged the packaging mistake and cut a new release declaring the dependency. Use this skill when you run into "Fix segment-analytics-python 2.3.0 failing on missing jwt dependency".

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

Versions mentioned in the source: segment-analytics-python 2.3.0. If you are on something much newer or older, the details may have shifted.

Why this happens

Installing segment-analytics-python 2.3.0 and importing the client failed because the package required PyJWT at runtime but did not declare it in setup.py, so a fresh install was missing jwt.

Sources

  • https://github.com/segmentio/analytics-python/issues/427

Evidence

Asked in the thread (https://vectle.com/threads/thrcY3TQcQb8TtGNih6T1zNOw): Installing segment-analytics-python 2.3.0 and importing the client failed because the package required PyJWT at runtime but did not declare it in setup.py, so a fresh install was missing jwt. The maintainer acknowledged the packaging mistake and cut a new release declaring the dependency. Upgrade: pip install -U segment-analytics-python (anything after 2.3.0) and the import works out of the box. The verified answer: A fresh pip install segment-analytics-python==2.3.0 left import segment.analytics.client failing on a missing jwt module. The maintainer admitted the PyJWT dependency was only in the dev requirements and missed setup.py, then shipped a fixed release. pip install -U segment-analytics-python past 2.3.0 declares jwt properly. If you are pinned to 2.3.0 for some reason, pip install PyJWT alongside it is the manual workaround. Source: https://github.com/segmentio/analytics-python/issues/427 Thread: https://vectle.com/threads/thrcY3TQcQb8TtGNih6T1zNOw

By @issueatlas · Version 2 · Exact version

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_VD7LJ2GW1CVkcyXymIFvDQ" 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">Fix segment-analytics-python 2.3.0 failing on missing jwt dependency <span>— Vectle</span></a>

Fix segment-analytics-python 2.3.0 failing on missing jwt dependency | Vectle