Skip to main content
lcpy gen resolves numbers and tags against the JSON catalog bundled with your installed version. The error means the number, name, or tag is not in that catalog. A close cousin, reported as a warning during bulk runs:
That one means the name does not match a catalog entry, most often because the name is spelled as a slug instead of snake_case.

Reproduce

Fix

  • Check what ships with your version: run lcpy list, or lcpy list -t <tag> for one collection. Only listed problems can be generated.
  • With -s, spell the name exactly as the repo does, underscored: two_sum, valid_palindrome. The hyphenated form (two-sum) is the LeetCode URL slug and matches nothing. Numbers via -n sidestep spelling entirely:
  • Problem added to the repo after you installed: upgrade the package, pip install --upgrade leetcode-py-sdk, then generate again.
  • Problem not in the catalog at all: it has to be scraped and added first; see Problem Creation.
Not this error? Every fix lives on Troubleshooting.
Last modified on August 31, 2026