env-management
Was er macht
Dieser Skill zeigt einem Agenten, wie er fehlende Pakete in einer Notebook-Sitzung behandelt. Er erklärt, wie man die Version eines Pakets prüft und es über das genehmigte Werkzeug installiert, statt direkt in einer Zelle zu installieren.
Wann du ihn nutzt
- ✓Wenn ein Notebook-Lauf mit einem Fehler über ein fehlendes Paket für Python oder R abbricht.
- ✓Wenn ein Nutzer wissen möchte, welche Version eines Pakets in der Notebook-Umgebung installiert ist.
- ✓Wenn Code eine versionsabhängige Funktion braucht und die Paketversion geprüft werden muss.
Link zum Skill
https://github.com/aipoch/open-science/blob/main/resources/skills/env-management/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Mein Notebook bricht mit einem ModuleNotFoundError für pandas ab. Repariere die Umgebung und starte den Lauf neu.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent erkennt das fehlende Paket und nutzt das Paketverwaltungswerkzeug, um es in der zugewiesenen Laufzeit zu installieren, statt den Code auf eine andere Bibliothek umzustellen. Vorher kann er die installierten Versionen mit dem Prüfwerkzeug ansehen.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Environment and package management
The notebook runs against the session's bound runtime: the app-managed default (default-python / default-r) unless you bind another one with notebook_bind_runtime — a named environment you created, or one of the user's own detected interpreters. You never activate environments by hand, and you never install packages from inside a cell. Installs happen in the trusted main process through a single tool, manage_packages, and always land in the currently bound runtime. This page is the workflow for getting a package installed and for knowing when a package is not something you can install yourself.
When a package is missing
A run that fails with ImportError / ModuleNotFoundError (Python) or Error in library(x): there is no package called 'x' (R) means the package is not in the environment yet. The fix is one manage_packages call, not a code change. Do not rewrite the cell to use a different library that "does roughly the same thing" — install the package the task actually needs. Do not fall back to reading data or computing results a worse way to dodge the missing import.
Check an installed version
Use inspect_packages(language, packages) when the user asks whether a package is installed in an app-managed runtime or which version is present, or when your code depends on a version-specific feature. It reads package metadata from the session's bound app-managed runtime without importing the package or changing the environment. An installed result does not prove the import will succeed; use notebook_execute when importability itself is the question.
Inspection does not provision a missing app-managed default runtime. If it reports DEFAULT_RUNTIME_NOT_READY, use notebook_execute in that language to prepare the runtime under notebook execution approval, then retry inspect_packages.
inspect_packages intentionally rejects a user-owned external runtime because reading its metadata executes that interpreter. Use notebook_execute for an external runtime so the user sees the normal notebook execution approval.
Do not use inspection as a mandatory preflight for every install. For a clear missing-package error, call manage_packages directly; installation is the recovery action, while inspection is for explicit version and compatibility questions.
Route by language
- Python package →
manage_packages(language="python", packages=["numpy", "pandas"]). - R package →
manage_packages(language="r", packages=["ggplot2"]). R packages install from conda-forge asr-<name>automatically; pass the plain CRAN name (ggplot2, notr-ggplot2). - A PyPI-only Python package that is not on conda → add
usePip=true. - A package that needs a specific conda channel → pass
channels=["bioconda"]. Leavechannelsoff otherwise; the app supplies the right default mirror.
manage_packages always returns a target receipt. When resolution succeeds, it identifies the implicit default or explicit binding and the actual runtime; selection:"unresolved" means no target could be established. After a failed bind or switch, inspect bindingChanged and target before deciding where a later install would run. Every install persists — there is no "temporary" install to undo later. Install once; it stays available in later cells and sessions on that runtime. To install into a different environment, bind or switch to it first (notebook_bind_runtime / notebook_switch_runtime); there is no per-call environment argument. The app-managed defaults are additive-only (bare name or name==version); for uninstalls, version ranges, or git/URL specs, create a named environment and install there.
Restart the kernel after an install when told to
manage_packages returns a compact result with ok, needsRestart, the installer method, the target receipt, verified packageChanges, and an actionable error on failure. A requested package change reports installed, updated, unchanged, or removed plus its observed before/after version when available. unchanged means only that distribution metadata in the reported target did not change; it does not prove the current Kernel can import the module. When importability or the loaded version matters, use notebook_execute to import the package and inspect its version. When needsRestart is true (always true for R, because the running kernel holds the old library state), call notebook_restart before you `import
Häufige Fragen
Kann ich pip install in einer Zelle ausführen?
Nein. Der Skill sagt, Installationen in Zellen sind nicht erlaubt, Installationen laufen über das Paketverwaltungswerkzeug.
Soll ich meinen Code auf eine andere Bibliothek umstellen?
Nein. Der Skill sagt, das Paket zu installieren, das die Aufgabe tatsächlich braucht.
Welche Umgebung bekommt die Installation?
Die, die der Sitzung zugewiesen ist, entweder das Standard der App oder eine benannte Umgebung.
Details
Originalbeschreibung des Autors
Use when a notebook run fails on a missing package (ImportError, ModuleNotFoundError, "there is no package called"), when you need to inspect an installed package version, or when you need to install, add, or manage Python or R packages for the notebook runtime. Covers inspect_packages, routing Python vs R through manage_packages, why in-cell %pip/!pip/install.packages() and OS installers are forbidden, restarting the kernel after an install, and when to stop and ask the user.
repo: aipoch/open-science
Beliebtheit
- GitHub-Sterne
- 5.4k
- Platz im Ranking
- #14857
- Lizenz
- Apache-2.0
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
alphafold2
5.4kHilft deinem Agenten, die 3D-Struktur eines Proteins aus seiner Sequenz vorherzusagen, auch für Proteinkomplexe, mit AlphaFold2 über den ColabFold-Runner.
boltz
5.4kHilft deinem Agenten, die Struktur von Protein-, DNA-, RNA- und Kleinmolekül-Komplexen mit dem Open-Source-Modell Boltz-2 vorherzusagen, optional mit Schätzungen der Bindungsaffinität.
borzoi
5.4kSagt für deinen Agenten genomweite Aktivitätsspuren, etwa Expression und Zugänglichkeit, aus DNA-Sequenzen vorher und vergleicht Varianten nach ihrer vorhergesagten Wirkung.
chai1
5.4kHilft deinem Agenten, die Struktur von Protein-, Nukleinsäure- und Ligand-Komplexen aus einer FASTA-Datei vorherzusagen, mit dem Apache-lizenzierten Modell Chai-1.
Ähnliche Skills
openclaw-update
394kHilft deinem Agenten, ein bestehendes OpenClaw-Gateway zu aktualisieren, mit der Methode, die zu deiner Installation passt, während deine Sitzung weiterläuft.
diagnose-gateway
394kHilft deinem Agenten herauszufinden, warum dein OpenClaw-Gateway fehlschlägt, indem er Einstellungen, Kanäle und Ports prüft, ohne etwas zu ändern.
crabbox-apps
394kHilft deinem Agenten, eine App auf einer temporären Cloud-Maschine zu öffnen und auszuführen und ihre Ansicht in deinem Chat-Seitenpanel zu zeigen.