hf-cloud-python-env-setup
Was er macht
Dieser Skill bereitet eine isolierte Python-Umgebung für Machine-Learning-Bereitstellungen und AWS-Skripte vor. Er ist für Leute gedacht, die auf Fehler durch eine falsche Python-Version oder veraltete Bibliotheken stoßen.
Wann du ihn nutzt
- ✓Wenn Python-Code für eine SageMaker-Bereitstellung, einen Trainingsjob oder eine AWS-Automatisierung laufen soll.
- ✓Wenn der Agent gleich Pakete installieren oder boto3 aufrufen wird.
- ✓Wenn du den Agenten bittest, die Umgebung einzurichten.
Link zum Skill
https://github.com/huggingface/skills/blob/main/skills/hf-cloud-python-env-setup/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
“Richte eine saubere Python-Umgebung ein, damit ich die SageMaker-Bereitstellungsskripte ausführen kann.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Die KI legt eine getrennte Umgebung mit einer unterstützten Python-Version von 3.10 bis 3.12 an und installiert die neuesten Versionen der benötigten Pakete. Danach prüft sie die installierten Versionen zuverlässig.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Python Environment Setup for SageMaker
Most SageMaker deployment failures that look like AWS problems are actually Python environment problems: wrong Python version, broken dependency resolution, stale SDK that doesn't know about a current API. This skill makes env setup boring and correct.
Core rules
- Never use the system Python. Always work inside an isolated environment.
- Pin the Python version, not the package versions. Use 3.10, 3.11, or 3.12. Avoid 3.13+ — ML libraries lag on wheel availability and dependency resolution breaks in confusing ways.
- Install the latest of each package. Don't defensively pin
boto3orawscli. Newer ones have current API surfaces and security fixes. Only pin if the user explicitly requires a specific version. - Check installed versions correctly. Use
importlib.metadata.version("package-name"), nevermodule.__version__. The latter is inconsistent across packages. - The bundled scripts use
boto3directly. The SageMaker Python SDK is a valid alternative — see "boto3 vs the SageMaker SDK" below.
boto3 vs the SageMaker SDK
The bundled deploy scripts (deploy.py, deploy_async.py, teardown.py) use boto3 directly and read image URIs from AWS's published Deep Learning Containers catalog. That fits this workflow's explicit-stages design — each skill produces a concrete value (region, role ARN, image URI) that the next one consumes — and boto3 is the stable underlying API client.
The SageMaker Python SDK (v3) is fine to use when the user prefers it or their project already does. Since PR #5960 (June 2026), ModelBuilder auto-routes HuggingFace models to the current containers (text-generation → HuggingFace vLLM, multimodal → vLLM-Omni, embeddings → TEI). Don't avoid the SDK over stale-image or wrong-container concerns — that routing is fixed.
Two specific SDK cases that still need care:
- Generative rerankers: the SDK routes the
text-rankingtask to TEI unconditionally, which is wrong for causal-LM rerankers like Qwen3-Reranker — those need vLLM (seehf-cloud-serving-image-selection). Pass the container explicitly for these models. - SSO assumed-role credentials: v3 has had credential-resolution regressions in
ModelTrainer/FrameworkProcessorunder SSO profiles. If SDK calls fail with credential errors whileaws sts get-caller-identitysucceeds in the same shell, suspect this rather than your AWS config.
If you use the SDK, install it into the isolated env like everything else (.venv/bin/python -m pip install sagemaker). The bundled scripts don't require it.
How to set up
The fastest path is the bundled script — it's Python, so it runs the same on Windows, macOS, and Linux:
python3 scripts/setup_env.py # macOS / Linux
python scripts/setup_env.py # Windows (PowerShell / cmd)
This script detects uv and uses it if available (faster), falls back to the stdlib venv module, creates .venv/ with Python 3.12 (override: python3 setup_env.py .venv 3.11), refuses unsupported Python versions, installs from the bundled requirements.txt, and is idempotent. It also prints the correct interpreter path for the host OS (see below).
Manual equivalent:
# Preferred: uv
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python --upgrade boto3 awscli # Windows: .venv\Scripts\python.exe
# Fallback: stdlib venv
python3.12 -m venv .venv
.venv/bin/python -m pip install --upgrade pip boto3 awscli
After setup, invoke the env's Python explicitly rather than activating the venv. The interpreter path differs by platform:
.venv/bin/python deploy.py # macOS / Linux
.venv\Scripts\python.exe deploy.py # Windows
This works the same in scripts, interactive shells, and agent tool calls. The rest of this skill writes .venv/bin/python for brevity — on Windows substitute .venv\Scripts\python.exe.
Verifying
.venv/bin/python scripts/check_versions.py
Prints versions of boto3, botocore, awscli. Uses importlib.metadata.version() so it works on every package, including ones without __version__. Pass arbitrary names: ... check_versions.py transformers huggingface_hub.
Deployment-specific extras
Default requirements.txt covers SageMaker orchestration. Some deployments need extras (`hu
Häufige Fragen
Warum nicht das System-Python nutzen?
Der Skill arbeitet immer in einer isolierten Umgebung, damit andere Software auf deinem Rechner nicht stört.
Legt er Paketversionen fest?
Nein. Er installiert die neuesten Paketversionen, außer du verlangst eine bestimmte.
Warum die neuesten Python-Versionen meiden?
Machine-Learning-Bibliotheken hinken neuen Python-Versionen oft hinterher, was verwirrende Installationsprobleme verursacht.
Details
Originalbeschreibung des Autors
Set up an isolated Python environment for SageMaker / AWS work, with the right Python version and current boto3. Use this skill whenever Python code will be executed for a SageMaker deployment, training job, or any AWS automation — including when about to run `pip install`, when about to invoke `boto3`, when creating or activating a virtualenv, or when the user asks to "set up the environment". Never use system Python and never `pip install` into it. Always isolate. This skill prevents the most common failure modes: wrong Python version, dependency conflicts, and stale SDKs.
repo: huggingface/skills
Beliebtheit
- GitHub-Sterne
- 11k
- Platz im Ranking
- #11767
- Lizenz
- Apache-2.0
- Aktualisiert
- 30.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
hf-cli
11kHilft deinem Agenten, das Hugging-Face-Kommandozeilenwerkzeug hf zu nutzen, um Modelle, Datensätze, Spaces und Repositorys herunterzuladen, hochzuladen und den lokalen Cache zu verwalten.
hf-cloud-aws-context-discovery
11kHilft deinem Agenten, dein AWS-Profil, deine Region und Kontodaten zu finden, bevor Cloud-Arbeiten beginnen, damit er nicht rät, welches Konto er nutzen soll.
hf-cloud-sagemaker-deployment-planner
11kHilft deinem Agenten, die Bereitstellung eines Modells auf Amazon SageMaker zu planen und zwischen Echtzeit-, serverlosem, asynchronem und Batch-Hosting mit sinnvollen Standards zu wählen.
hf-cloud-sagemaker-iam-preflight
11kHilft deinem Agenten, vor einer Bereitstellung zu prüfen, ob eine nutzbare SageMaker-Ausführungsrolle existiert, statt ungeprüft neue Berechtigungen in deinem AWS-Konto anzulegen.
Ä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.