{"record":{"id":"10a018d44907fa7f","repo":"rohitg00/ai-engineering-from-scratch","slug":"h5py-is-required-for-this-lesson-install-with-pi","errorCode":null,"errorMessage":"h5py is required for this lesson. Install with: pip install h5py","messagePattern":"h5py is required for this lesson\\. Install with: pip install h5py","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py","lineNumber":34,"sourceCode":"\nfrom __future__ import annotations\n\nimport hashlib\nimport json\nimport random\nimport struct\nimport sys\nimport tempfile\nfrom dataclasses import asdict, dataclass, field\nfrom pathlib import Path\nfrom typing import Iterable, Iterator\n\nimport numpy as np\n\ntry:\n    import h5py\nexcept ImportError as exc:\n    raise SystemExit(\n        \"h5py is required for this lesson. Install with: pip install h5py\"\n    ) from exc\n\n\nDEFAULT_CHUNK_SIZE = 8192\nDEFAULT_WINDOW_SIZE = 64\nBOUNDARY_TOKEN_ID = 0\nTOKEN_DTYPE = np.uint16\n\n\n@dataclass\nclass ShardWriteResult:\n    \"\"\"Per-shard write outcome.\"\"\"\n\n    shard_id: str\n    path: str\n    token_count: int\n    document_count: int","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py#L16-L52","documentation":"Error \"h5py is required for this lesson. Install with: pip install h5py\" thrown in rohitg00/ai-engineering-from-scratch.","triggerScenarios":"Thrown at phases/19-capstone-projects/43-hdf5-tokenized-corpus/code/main.py:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}