badges/shields · error · InvalidResponse

versions are missing for

Error message

${name} versions are missing for ${packageName}

What it means

The PyPI framework-versions badge throws InvalidResponse when, after fetching the package metadata, no trove classifiers match the `Framework :: <Name> :: <version>` regex — meaning the parsed versions list is empty. It indicates the package (or PyPI response) declares no framework version classifiers for the requested framework.

Solutions

  1. Check the package's PyPI page for 'Framework :: X :: version' classifiers and confirm the framework name matches
  2. Verify the packageName is the PyPI package that declares those classifiers
  3. Add the appropriate Framework classifiers to setup.cfg/setup.py and publish a release

Example fix

// before
setup(..., classifiers=[])  # no Framework:: classifiers
// after
classifiers=["Framework :: Django", "Framework :: Django :: 4.2"]
Defensive patterns

Strategy: try-catch

Validate before calling

const meta = await fetch(`https://pypi.org/pypi/${packageName}/json`)
const data = await meta.json()
const has = (data.info?.classifiers ?? []).some(c => c.startsWith(`Framework :: ${framework}`))
if (!has) throw new Error(`${packageName} declares no Framework :: ${framework} classifiers`)

Type guard

function hasFrameworkVersions(data, framework) {
  return Array.isArray(data?.info?.classifiers) &&
    data.info.classifiers.some(c => new RegExp(`^Framework :: ${framework} :: [\\d.]+$`).test(c))
}

Try / catch

try {
  const badge = await service.handle({ framework: 'django', packageName: 'my-django-app' })
} catch (err) {
  if (err instanceof InvalidResponse && /versions are missing/.test(err.prettyMessage)) {
    return renderBadge({ label: 'django', message: 'n/a' })
  }
  throw err
}

Prevention

When it happens

Trigger: Requesting e.g. /pypi/frameworkversions/django/<pkg> for a package that has no `Framework :: Django :: x.y` classifiers; a typo'd framework name; a package whose latest release dropped the classifiers.

Common situations: Package authors removing classifiers in a new release; users confusing package name with framework name; PyPI classifier format changes breaking the regex.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/2596d2e70a0a062b. Report an issue: GitHub.

Appendix: source

Thrown at services/pypi/pypi-framework-versions.service.js:97

      label,
      message: sortPypiVersions(versions).join(' | '),
      color: 'blue',
    }
  }

  async handle({ frameworkName, packageName }, { pypiBaseUrl }) {
    const classifier = frameworkNameMap[frameworkName]
      ? frameworkNameMap[frameworkName].classifier
      : frameworkName
    const name = frameworkNameMap[frameworkName]
      ? frameworkNameMap[frameworkName].name
      : frameworkName
    const regex = new RegExp(`^Framework :: ${classifier} :: ([\\d.]+)$`)
    const packageData = await this.fetch({ egg: packageName, pypiBaseUrl })
    const versions = parseClassifiers(packageData, regex)

    if (versions.length === 0) {
      throw new InvalidResponse({
        prettyMessage: `${name} versions are missing for ${packageName}`,
      })
    }

    return this.constructor.render({ name, versions })
  }
}

View on GitHub (pinned to 766fd8bc89)