hf-cloud-python-env-setup
O que ela faz
Esta skill prepara um ambiente Python isolado para scripts de implantação de machine learning e da AWS. É para pessoas que têm erros causados por uma versão errada do Python ou por bibliotecas desatualizadas.
Quando usar
- ✓Quando um código Python vai rodar em uma implantação no SageMaker, em um treinamento ou em uma automação da AWS.
- ✓Quando o agente está prestes a instalar pacotes ou chamar o boto3.
- ✓Quando você pede ao agente para montar o ambiente.
Link da skill
https://github.com/huggingface/skills/blob/main/skills/hf-cloud-python-env-setup/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Monte um ambiente Python limpo para eu rodar os scripts de implantação do SageMaker.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A IA cria um ambiente separado com uma versão compatível do Python, entre 3.10 e 3.12, e instala as versões mais recentes dos pacotes necessários. Depois verifica as versões instaladas de forma confiável.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Por que não usar o Python do sistema?
A skill sempre trabalha em um ambiente isolado, para que outros programas do seu computador não interfiram.
Ela fixa versões dos pacotes?
Não. Ela instala as versões mais recentes dos pacotes, a menos que você peça uma versão específica.
Por que evitar as versões mais novas do Python?
As bibliotecas de machine learning podem demorar a acompanhar as versões mais novas do Python, o que causa problemas de instalação confusos.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 11 mil
- Posição no ranking
- #11767
- Licença
- Apache-2.0
- Atualizada em
- 30/10/2026
Comentários
- …
Mais skills deste repositório
hf-cli
11 milAjuda seu agente a usar a ferramenta de linha de comando da Hugging Face para baixar, enviar e gerenciar modelos, datasets, Spaces, repositórios e o cache local.
hf-cloud-aws-context-discovery
11 milAjuda seu agente a encontrar seu perfil, região e dados da conta AWS antes de qualquer trabalho na nuvem, para que ele não adivinhe qual conta usar.
hf-cloud-sagemaker-deployment-planner
11 milAjuda seu agente a planejar a implantação de um modelo no Amazon SageMaker, escolhendo hospedagem em tempo real, sem servidor, assíncrona ou em lote, com padrões sensatos.
hf-cloud-sagemaker-iam-preflight
11 milAjuda seu agente a confirmar que existe um papel de execução do SageMaker utilizável antes de implantar, em vez de criar novas permissões na sua conta da AWS sem verificar.
Skills parecidas
openclaw-update
394 milAjuda seu agente a atualizar um OpenClaw Gateway existente, escolhendo o método que combina com a instalação e mantendo sua sessão funcionando.
diagnose-gateway
394 milAjuda seu agente a descobrir por que seu OpenClaw Gateway está falhando, verificando configurações, canais e portas sem alterar nada.
crabbox-apps
394 milAjuda seu agente a abrir e executar um app em uma máquina temporária na nuvem e depois mostrar a visualização dele no painel lateral do seu chat.