Agent Native

hf-cloud-python-env-setup

Sets up an isolated Python environment for SageMaker and AWS work with the correct Python version (3.10, 3.11, or 3.12) and current boto3 and awscli.

by Hugging FaceOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (huggingface)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
License
Apache-2.0 (permissive)
Pin
c3ff942pinned Oct 9, 2026
Context cost
about 1,500 tokenswhen the skill loads
GitHub stars
11,150on huggingface/skills
Scripts
2 scripts

What it does

“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.”
The author's description, from SKILL.md

Generated summary from the skill's own text

Sets up an isolated Python environment for SageMaker and AWS work with the correct Python version (3.10, 3.11, or 3.12) and current boto3 and awscli. The bundled setup script creates a virtual environment, installs dependencies, and provides version verification tools. This prevents common deployment failures from wrong Python versions, dependency conflicts, and stale SDKs.

When to use it

  • Before running SageMaker deployment or training scripts with boto3
  • When setting up a new project for AWS automation and model serving
  • Before executing pip install or invoking boto3 in any AWS workflow
  • When environment setup is needed to avoid dependency conflicts

When not to

  • If the project uses Python 3.13 or later due to incomplete wheel availability
  • When system Python isolation is not required or already managed elsewhere

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add huggingface/skills --skill hf-cloud-python-env-setup

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install huggingface/skills hf-cloud-python-env-setup@c3ff942be3e07116b475253f0a8fc4f54682c1a8

Installs the commit we checked (c3ff942).

Copy by hand

Download the folder at c3ff942 and put it in .claude/skills/hf-cloud-python-env-setup for Claude Code and in .agents/skills/hf-cloud-python-env-setup for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at c3ff942

Claude Code plugin

/plugin install huggingface-skills@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "hf-cloud-python-env-setup" by Hugging Face.

Source, pinned to commit c3ff942be3e07116b475253f0a8fc4f54682c1a8:
https://github.com/huggingface/skills/tree/c3ff942be3e07116b475253f0a8fc4f54682c1a8/skills/hf-cloud-python-env-setup

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/hf-cloud-python-env-setup/ for Claude Code and .agents/skills/hf-cloud-python-env-setup/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/hugging-face/hf-cloud-python-env-setup

SKILL.md at the pin

---
name: hf-cloud-python-env-setup
description: '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.'
---

# 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

1. **Never use the system Python.** Always work inside an isolated environment.
2. **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.
3. **Install the latest of each package.** Don't defensively pin `boto3` or `awscli`. Newer ones have current API surfaces and security fixes. Only pin if the user explicitly requires a specific version.
4. **Check installed versions correctly.** Use `importlib.metadata.version("package-name")`, never `module.__version__`. The latter is inconsistent across packages.
5. **The bundled scripts use `boto3` directly.** 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](https://aws.github.io/deep-learning-containers/reference/available_images/). 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](https://github.com/aws/sagemaker-python-sdk/pull/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-ranking` task to TEI unconditionally, which is wrong for causal-LM rerankers like Qwen3-Reranker — those need vLLM (see `hf-cloud-serving-image-selection`). Pass the container explicitly for these models.
- **SSO assumed-role credentials**: v3 has had credential-resolution regressions in `ModelTrainer` / `FrameworkProcessor` under SSO profiles. If SDK calls fail with credential errors while `aws sts get-caller-identity` succeeds 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:

```bash
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:

```bash
# 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:

```bash
.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

```bash
.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 (`huggingface_hub` for model inspection, `transformers` for tokenizer validation). Add these to a deployment-specific requirements file in the project, install with the env's Python, don't pin unless there's a reason.

## Common pitfalls

**Mysterious `pip install` resolution errors**
Almost always Python 3.13+ trying to install packages without wheels yet, or installing into a polluted system Python. Recreate at 3.12: delete `.venv` and re-run `python3 setup_env.py .venv 3.12` (the script recreates the env when the version doesn't match, so you can also just re-run it).

**`pip install` succeeded but the script says "module not found"**
You installed into a different interpreter than the one running the script. Always invoke Python explicitly: `.venv/bin/python -m pip install ...` and `.venv/bin/python deploy.py`.

**Inline `python -c "..."` one-liners fail in PowerShell**
PowerShell's quoting rules mangle nested/escaped quotes in inline Python. Don't debug the quoting — write the snippet to a small `.py` file and run that. (All bundled helpers are files for exactly this reason.)

**boto3 call fails with "unknown parameter"**
Your boto3 is older than the API surface. Upgrade with `.venv/bin/python -m pip install --upgrade boto3`. Don't downgrade the script to match an old version.

**`sagemaker` (the SDK) installed but the bundled scripts fail**
The bundled scripts don't use the SDK — they only need `boto3`/`awscli` from `requirements.txt`. Installing `sagemaker` alongside is harmless, but it doesn't replace the requirements install.

From huggingface/skills at c3ff942, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at c3ff942

Files

4 files, 13 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at c3ff942

More from Hugging Face

  • hf-cloud-aws-context-discovery

    This skill reads the user's local AWS configuration to discover their active profile, region, account ID, and caller identity before any AWS work begins.

    Claude Code, Codex, Cursor +4 · about 830 tokens · pinned 6 days ago

  • hf-cloud-sagemaker-deployment-planner

    This skill helps users plan and execute deployments of machine learning models to Amazon SageMaker by gathering requirements, selecting appropriate deployment…

    Claude Code, Codex, Cursor +4 · about 1.9K tokens · pinned 6 days ago

  • hf-cloud-sagemaker-iam-preflight

    This skill validates or creates an AWS IAM execution role before deploying SageMaker endpoints, training jobs, or models.

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 1.6K tokens · pinned 6 days ago

  • hf-cloud-sagemaker-production-defaults

    Deploys SageMaker endpoints with production defaults: autoscaling based on traffic, CloudWatch alarms for latency and errors, and consistent tagging.

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 6.7K tokens · pinned 6 days ago

  • hf-cloud-serving-image-selection

    This skill helps select the correct SageMaker serving container image for model deployments and retrieves its current URI from AWS's Deep Learning Containers…

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 4.3K tokens · pinned 6 days ago

  • hf-mcp

    This skill connects the agent to Hugging Face Hub via MCP server, enabling searches across models, datasets, Spaces, and papers.

    Claude Code, Codex, Cursor +4 · about 1.2K tokens · pinned 6 days ago

All Cloud and DevOps skills
  • release-candidate-prep

    Prepares a local Python SDK release candidate in a dedicated Git worktree when explicitly invoked with a version number.

    by OpenAIOfficial publisher

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 4.8K tokens · pinned 6 days ago

  • huggingface-spaces

    Create and deploy machine-learning applications on Hugging Face Spaces using Gradio, Docker, or Static SDKs.

    by Hugging FaceOfficial publisher

    Claude Code, Codex, Cursor +4 · about 4.3K tokens · pinned 6 days ago

  • huggingface-vision-trainer

    Trains vision models for object detection, image classification, and SAM/SAM2 segmentation on Hugging Face Jobs cloud GPUs.

    by Hugging FaceOfficial publisher

    Contains scripts

    Claude Code · about 7.3K tokens · pinned 6 days ago

  • huggingface-zerogpu

    This skill provides rules and patterns for building ML demos on Hugging Face Spaces with ZeroGPU hardware, covering the @spaces.GPU decorator, duration and…

    by Hugging FaceOfficial publisher

    Claude Code, Codex, Cursor +4 · about 4.3K tokens · pinned 6 days ago

  • retail-virtual-tryon

    Creates virtual try-on agents on Google Cloud using Gemini image models and Veo video generation, supporting static image try-ons and catwalk animations.

    by GoogleOfficial publisher

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 3.3K tokens · pinned 6 days ago

  • agent-advisor

    Guides startups through a phased decision process to choose an AWS runtime for AI agents (AgentCore, ECS, EKS, Lambda, or Lambda MicroVMs), plan migrations of…

    by Amazon (AWS)Official publisher

    Contains scripts

    Claude Code · about 4.6K tokens · pinned 6 days ago

Open roles at Hugging Face

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use