env-management
하는 일
이 스킬은 노트북 세션에서 패키지가 없을 때 처리하는 방법을 에이전트에게 가르칩니다. 셀 안에서 설치하지 않고, 승인된 도구로 패키지 버전을 확인하고 설치하는 방법을 설명합니다.
사용하는 경우
- ✓노트북 실행이 Python이나 R의 패키지 누락 오류로 실패할 때.
- ✓사용자가 노트북 환경에 설치된 패키지 버전을 묻는 경우.
- ✓코드가 특정 버전 기능에 의존하고 패키지 버전 확인이 필요할 때.
스킬 링크
https://github.com/aipoch/open-science/blob/main/resources/skills/env-management/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 노트북이 pandas에 대해 ModuleNotFoundError로 실패합니다. 환경을 고치고 다시 실행해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 누락된 패키지를 확인하고, 패키지 관리 도구를 써서 연결된 런타임에 설치합니다. 코드를 다른 라이브러리를 쓰도록 바꾸지 않습니다. 먼저 inspect 도구로 설치된 버전을 확인할 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
셀 안에서 pip install을 실행할 수 있나요?
아닙니다. 스킬은 셀 안의 설치가 허용되지 않으며, 설치는 패키지 관리 도구를 통해서만 한다고 설명합니다.
코드를 다른 라이브러리를 쓰도록 바꿔야 하나요?
아닙니다. 스킬은 작업에 실제로 필요한 패키지를 설치하라고 설명합니다.
어느 환경에 설치되나요?
세션에 연결된 환경, 즉 앱 기본 환경이나 이름 있는 환경입니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 5.4k
- 순위
- #14857
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
alphafold2
5.4k에이전트가 ColabFold 러너를 통해 AlphaFold2로 단백질 서열의 3차원 구조를 예측하고, 단백질 복합체도 다루도록 돕습니다.
boltz
5.4k에이전트가 오픈 소스 Boltz-2 모델로 단백질, DNA, RNA, 저분자 복합체의 구조를 예측하도록 돕고, 선택적으로 결합 친화도 추정도 제공합니다.
borzoi
5.4k에이전트가 DNA 서열로부터 발현과 접근성 같은 게놈 전체의 활성 트랙을 예측하고, 예측된 효과로 변이를 비교하도록 돕습니다.
chai1
5.4k에이전트가 Apache 라이선스의 Chai-1 모델을 사용해, 하나의 FASTA 파일로 단백질, 핵산, 리간드 복합체의 구조를 예측하도록 돕습니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.