title: "## pipeio_nb_exec runs papermill from MCP server env, not notebook kernel env status: resolved created: 2026-04-09 updated: 2026-04-09 timestamp: 20260409-232034-115590 tags: [issue] source: agent-observation project_primary: projio capture_id: 20260409-232032-63af45 confidence: 1.0 transcript_file: /storage2/arash/worklog/workflow/captures/20260409-232032-63af45/transcript.txt
pipeio_nb_exec runs papermill from MCP server env, not notebook kernel env¶
When pipeio_nb_exec runs a notebook that specifies kernel: cogpy, papermill executes from the MCP server's own Python environment (rag), not the cogpy conda env. This causes ModuleNotFoundError for any package only installed in the kernel env (cogpy, pipeio, sutil, etc.).
Observed behavior¶
pipeio_nb_exec(flow="preprocess_ieeg", name="ttl_characterization_removal", timeout=7200)→ error at first cell:ModuleNotFoundError: No module named 'utils.bootstrap'- The notebook has
kernel: cogpyin its jupytext metadata and a registered Jupyter kernelspeccogpypointing to the conda env.
Expected behavior¶
pipeio_nb_exec should either:
1. Run conda run -n <kernel_env> papermill ... (resolve kernel name → conda env), or
2. Use jupyter nbconvert --execute --ExecutePreprocessor.kernel_name=cogpy which respects the kernelspec, or
3. Launch papermill with -k cogpy and let Jupyter's kernel machinery handle env activation.
Workaround¶
Manual: conda run -n cogpy jupyter nbconvert --to notebook --execute --ExecutePreprocessor.kernel_name=cogpy --ExecutePreprocessor.timeout=7200 ...
Source context: pixecog¶
PixEcog (pixecog): Neuropixels and ECoG dataset and analysis
Recent commits:
8dc0d9d Pipeline docs: gitignore docs/pipelines/, relocate hand-authored files
96cd1ec Refactor sharpwaveripple/contracts: extract generic helpers to utils/io, remove pipelines __init__.py
36f9326 Add result note directory and sample note
README:
type: readme
Quick Start for Collaborators¶
Follow this checklist to get started with Pixecog documentation and workflows.
🐀 Pixecog Project — Compact Overview¶
Core principles
- One immutable BIDS raw dataset (
raw/) as the canonical baseline - Each analysis pipeline ha
Related Notes¶
- issue-arash-20260407-033705-872924.md — Directly related prior work: adding kernel/env option to pipeio_nb_exec and fixing papermill resolution — the same root problem
- issue-arash-20260407-040507-512890.md — Another pipeio_nb_exec subprocess bug (python_bin handling) — same component, closely related execution machinery
- issue-arash-20260407-050947-246557.md — Tracks pipeio fixes commit including input stage resolution — likely covers related pipeio_nb_exec patches
- issue-arash-20260407-162859-574826.md — About moving runtime env configuration — directly relevant to the env-resolution problem pipeio_nb_exec has