{"record":{"id":"ff0accda41fd9adb","repo":"cocoindex-io/cocoindex","slug":"zvec-is-required-to-use-the-zvec-connector-please","errorCode":null,"errorMessage":"zvec is required to use the zvec connector. Please install cocoindex[zvec].","messagePattern":"zvec is required to use the zvec connector\\. Please install cocoindex\\[zvec\\]\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/zvec/_target.py","lineNumber":46,"sourceCode":"from typing import (\n    Any,\n    Callable,\n    Collection,\n    Generic,\n    Iterator,\n    Literal,\n    NamedTuple,\n    Sequence,\n    cast,\n)\n\nimport numpy as np\nfrom typing_extensions import TypeVar\n\ntry:\n    import zvec as _zvec\nexcept ImportError as e:\n    raise ImportError(\n        \"zvec is required to use the zvec connector. Please install cocoindex[zvec].\"\n    ) from e\n\nimport msgspec\n\nimport cocoindex as coco\nfrom cocoindex.connectorkits import statediff, target\nfrom cocoindex.connectorkits.fingerprint import fingerprint_object\nfrom cocoindex._internal.context_keys import ContextKey, ContextProvider\nfrom cocoindex._internal.datatype import (\n    RecordType,\n    SequenceType,\n    TypeChecker,\n    analyze_type_info,\n    is_record_type,\n)\nfrom cocoindex.resources import schema as res_schema\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/zvec/_target.py#L28-L64","documentation":"The zvec connector requires the optional 'zvec' package. Importing the connector module (python/cocoindex/connectors/zvec/_target.py) raises ImportError with an install hint if the underlying zvec library is not installed, because the connector cannot function without it.","triggerScenarios":"Importing or using anything from cocoindex.connectors.zvec without the zvec package installed; using the cocoindex[zvec] extra-less base install.","commonSituations":"Fresh environment missing optional dependency; CI image installs cocoindex base but not extras; dependency removed by a lockfile pin conflict.","solutions":["pip install \"cocoindex[zvec]\" (or uv add \"cocoindex[zvec]\")","Verify `import zvec` works in the same interpreter","Check the environment/venv used at runtime matches where cocoindex is installed"],"exampleFix":"// before\npip install cocoindex\n// after\npip install \"cocoindex[zvec]\"","handlingStrategy":"fallback","validationCode":"import importlib.util\nif importlib.util.find_spec(\"zvec\") is None:\n    raise SystemExit('Install: pip install \"cocoindex[zvec]\"')","typeGuard":null,"tryCatchPattern":"try:\n    from cocoindex.connectors import zvec\nexcept ImportError as e:\n    if \"cocoindex[zvec]\" in str(e):\n        sys.exit('Missing dependency: pip install \"cocoindex[zvec]\"')\n    raise","preventionTips":["Add cocoindex[zvec] to project dependencies, not bare cocoindex","Pin the extra in CI requirements","Verify optional extras in a smoke test at env setup"],"tags":["python","import-error","optional-dependency","zvec"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}