{"record":{"id":"74fd091ad076c240","repo":"mem0ai/mem0","slug":"the-pymochow-library-is-required-please-install","errorCode":null,"errorMessage":"The 'pymochow' library is required. Please install it using 'pip install pymochow'.","messagePattern":"The 'pymochow' library is required\\. Please install it using 'pip install pymochow'\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"mem0/vector_stores/baidu.py","lineNumber":39,"sourceCode":"    )\n    from pymochow.model.schema import (\n        AutoBuildRowCountIncrement,\n        Field,\n        FilteringIndex,\n        HNSWParams,\n        Schema,\n        VectorIndex,\n    )\n    from pymochow.model.table import (\n        BM25SearchRequest,\n        FloatVector,\n        Partition,\n        Row,\n        VectorSearchConfig,\n        VectorTopkSearchRequest,\n    )\nexcept ImportError:\n    raise ImportError(\"The 'pymochow' library is required. Please install it using 'pip install pymochow'.\")\n\nlogger = logging.getLogger(__name__)\n\n\nclass OutputData(BaseModel):\n    id: Optional[str]  # memory id\n    score: Optional[float]  # distance\n    payload: Optional[Dict]  # metadata\n\n\nclass BaiduDB(VectorStoreBase):\n    _SAFE_FILTER_KEY = re.compile(r\"^[a-zA-Z_][a-zA-Z0-9_]*$\")\n\n    def __init__(\n        self,\n        endpoint: str,\n        account: str,\n        api_key: str,","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/vector_stores/baidu.py#L21-L57","documentation":"BaiduDB raises this ImportError at module import time when the 'pymochow' SDK (Baidu VectorDB client) cannot be imported. The try/except around the pymochow imports re-raises immediately, so merely importing mem0.vector_stores.baidu fails; the Baidu vector store cannot be used at all without the SDK.","triggerScenarios":"Any 'from mem0.vector_stores.baidu import BaiduDB' or VectorStoreConfig(provider='baidu') in an environment lacking pymochow. The error fires on the import line itself, before any class is instantiated.","commonSituations":"Using the Baidu VectorDB backend without installing the vendor SDK; mem0ai's optional extras not included in the deployment image; a CI matrix that imports every vector store module to smoke-test it.","solutions":["Install the SDK: pip install pymochow.","If you did not intend to use Baidu, stop importing/instantiating BaiduDB (the error is import-time, so even an unused import triggers it).","Pin a known-good pymochow version in requirements to avoid silent dependency drift."],"exampleFix":"# before\nfrom mem0.vector_stores.baidu import BaiduDB  # ImportError: pymochow required\n\n# after\n# pip install pymochow\nfrom mem0.vector_stores.baidu import BaiduDB","handlingStrategy":"validation","validationCode":"try:\n    import pymochow  # noqa: F401\n    BAIDU_OK = True\nexcept ImportError:\n    BAIDU_OK = False\n\nif not BAIDU_OK:\n    raise SystemExit(\"Baidu provider selected but pymochow is missing: pip install pymochow\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only import mem0.vector_stores.baidu lazily when the baidu provider is actually selected.","Pin pymochow in lockfiles so vendor SDK updates cannot break imports.","Smoke-test all configured providers' imports during deployment health checks."],"tags":["baidu","dependencies","import-error","vector-store"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}