Persistent "not enough values to unpack" Error on macOS (Apple Silicon)

Hello,

I'm encountering a persistent ValueError: not enough values to unpack (expected 4, got 2) when trying to load any custom recipe with positional arguments. This error occurs even after a complete environment rebuild with a recommended Python version.

System Details:

  • Prodigy Version: (Please run prodigy --version in your terminal and paste the result here)
  • Python Version: Python 3.10 (installed via Conda)
  • Operating System: macOS (Apple Silicon M-series)

Problem Description:
When I run a minimal test recipe that defines two positional arguments, Prodigy fails on startup with the "not enough values to unpack" error before any data is processed.

Debugging Steps Performed:
I have already performed the following steps with guidance, and the error still persists:

  1. Created a brand new, clean conda environment with python=3.10.
  2. Installed Prodigy v1.16.0 using the modern --extra-index-url pip command, which successfully installed compatible versions of spaCy (3.7.5) and NumPy (1.26.4).
  3. Confirmed that a minimal test recipe with zero arguments loads correctly.
  4. Confirmed that a minimal test recipe with two arguments consistently fails.

This indicates the issue is not with my code or dependencies but likely a deeper incompatibility.


Code to Reproduce the Error (test_recipe.py):
This minimal script consistently fails in the new environment:

import prodigy

@prodigy.recipe(
    "test.correct",
    dataset=("Dataset name", "positional"),
    source=("Source file", "positional")
)
def test_correct(dataset: str, source: str):
    print("This message never appears.")
    return { "dataset": dataset, "view_id": "text", "stream": [] }

Command Used:
prodigy test.correct my_test_dataset ./dummy_file.jsonl -F ./test_recipe.py

Full Traceback:
✘ Couldn't load Python code: ./test_recipe.py
not enough values to unpack (expected 4, got 2)

Welcome to the forum @PonderingPlatypus! :waving_hand:

Apologies for the delay in responding to this. For some reason your message got stuck in the spam filter :frowning: sorry about that!

Now, the reason you’re getting:

not enough values to unpack (expected 4, got 2)

is that your argument annotations are incomplete. The legacy Prodigy recipe decorator, which uses plac syntax expects a tuple of 4: description, argument type, shortcut, type / converter function. You’re providing only the first two, hence the tuple unpacking error you’re seeing.
If you provide the remaining descriptors:

import prodigy

@prodigy.recipe(
"test.correct",
dataset=("Dataset name", "positional", None, str),
source=("Source file","positional", None, str)
)
def test_correct(dataset: str, source: str):
print("This message never appears.")
return { "dataset": dataset, "view_id": "text", "stream": [ ] }

the recipe should run.

Also, like I mentioned plac is the legacy CLI syntax for Prodigy. As of 1.14, Prodigy has switched to radicli for more automation in processing the arguments. See here for more details.
Your recipe with radicli syntax would look like this:

import prodigy
from prodigy.core import Arg, recipe

@recipe(
"test.correct",
dataset=Arg(help="Dataset name"),
source=Arg(help="Source file")
)
def test_correct(dataset: str, source: str):
print("This message never appears.")
return { "dataset": dataset, "view_id": "text", "stream": [ ] }