matlab-call-python
Call Python libraries from MATLAB using the py. interface, pyrun, pyrunfile, or pyenv. Use when writing or executing MATLAB code that calls Python functions or passes data between MATLAB and Python. REQUIRED when triaging Python errors from MATLAB (ModuleNotFoundError, ImportError, "Unable to resolve the name 'py.*'"). REQUIRED when setting up Python environments for MATLAB, creating virtual environments, or installing Python packages for use with MATLAB.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-call-python --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Call Python from MATLAB Call Python libraries from MATLAB using modern APIs, correct environment setup, and structured error recovery. ## When to Use - Writing MATLAB code that calls Python via `py.*`, `pyrun`, or `pyrunfile` - MATLAB code fails with `ModuleNotFoundError`, `Python is not configured`, or other Python-related errors - User asks to set up Python for MATLAB or create a virtual environment - User asks to install a Python package for use in MATLAB ## When NOT to Use - Calling MATLAB from Python (MATLAB Engine API for Python — different direction) - Building MEX files or Python C extensions - Pure Python development with no MATLAB involvement - MATLAB Compiler or MATLAB Production Server deployment ## Rules ### NEVER use `pyargs` Use MATLAB name=value syntax for Python keyword arguments. `pyargs` is outdated (name=value available since R2021a). ```matlab % TEMPLATE — not executable (requires scikit-learn) rfc = py.sklearn.ensemble.RandomForestClassifier(n_estimators=int32(100), random_state=int32(42)); ``` ### NEVER use `pyversion` `pyversion` is not recommended. Use `pyenv`, which supports `terminate`, `ExecutionMode`, and environment switching. ### ALWAYS use the Bash
- When to Use
- When NOT to Use
- Rules
- NEVER use pyargs
- NEVER use pyversion
- ALWAYS use the Bash tool for pip installs and venv creation
- ALWAYS follow recovery procedure before any pip install or venv creation
- ALWAYS ask user confirmation before calling terminate(pyenv)
- ALWAYS wrap with integer types when Python expects int
- ALWAYS use pystringarray for string arrays (R2026a or later)
- Workflow
- 1. Write the Python code using modern syntax
- 2. Run the code
- 3. If it succeeds — done
What does the matlab-call-python skill do?
Call Python libraries from MATLAB using the py. interface, pyrun, pyrunfile, or pyenv. Use when writing or executing MATLAB code that calls Python functions or passes data between MATLAB and Python. REQUIRED when triaging Python errors from MATLAB (ModuleNotFoundError, ImportError, "Unable to resolve the name 'py.*'"). REQUIRED when setting up Python environments for MATLAB, creating virtual environments, or installing Python packages for use with MATLAB.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-call-python --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
