pipeio_nb_exec: python_bin as string breaks subprocess.run when using conda env¶
Problem¶
In src/projio/mcp/pipeio.py:1120, when env is set:
python_bin = f"{conda} run -n {env} python"
This creates a single string like "conda run -n cogpy python". But downstream in packages/pipeio/src/pipeio/notebook/lifecycle.py:1004-1006, _require_jupytext passes it as:
_sp.run([python_bin, "-m", "jupytext", "--version"], ...)
The single string "conda run -n cogpy python" is treated as a single executable path (element 0 of the list), not split into args. This causes FileNotFoundError caught by the except block, resulting in "jupytext not found".
Same issue in _jupytext() and the papermill command construction in mcp_nb_exec.
Fix¶
python_bin should be a list when it's a multi-part command, or lifecycle helpers should handle splitting. Simplest approach: change python_bin type from str | None to str | list[str] | None and use shlex.split() or pass as list from the wrapper:
python_bin = [conda, "run", "-n", env, "python"]
Then in lifecycle.py and mcp.py, normalize: cmd_prefix = [python_bin] if isinstance(python_bin, str) else python_bin.
Files to change¶
src/projio/mcp/pipeio.py:1120— pass list instead of stringpackages/pipeio/src/pipeio/notebook/lifecycle.py—_require_jupytext()and_jupytext()need to handle list python_binpackages/pipeio/src/pipeio/mcp.py:4275— papermill cmd construction needs same fix
Source context: pixecog¶
PixEcog (pixecog): Neuropixels and ECoG dataset and analysis
Recent commits:
9b2f6fa Scaffold ecephys TTL removal mod, flow overview + mod docs, demo notebook
80194af Add TTL characterization & removal demo notebook (preprocess_ieeg)
dc93496 Update mkdocs pipeline nav
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¶
- docs/log/issue/issue-arash-20260407-033705-872924.md — Directly related: both address pipeio_nb_exec — this note is the subprocess/python_bin bug, the other covers the kernel/env option addition and papermill resolution fix in the same feature