Hf Cloud Python Env Setup logo

Hf Cloud Python Env Setup

OrganizationPopular
huggingface
hf-cloud-python-env-setup

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.

Overview

Publisherhuggingface
Repositoryskills
Skill namehf-cloud-python-env-setup
Stars
11.1K
Forks
744
Bundled files
3
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by huggingface on GitHub. Read the source before you install it.

Installation

Install the Hf Cloud Python Env Setup AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/huggingface/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/hf-cloud-python-env-setup .claude/skills/hf-cloud-python-env-setup
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Hf Cloud Python Env Setup in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Hf Cloud Python Env Setup on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Hf Cloud Python Env Setup is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Hf Cloud Python Env Setup AI skill do?

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.

Why use Hf Cloud Python Env Setup on TypingMind?

Because you install it once and use it with any model. Hf Cloud Python Env Setup is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Hf Cloud Python Env Setup in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/huggingface/skills/tree/main/skills/hf-cloud-python-env-setup. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Hf Cloud Python Env Setup?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Hf Cloud Python Env Setup?

As many as you like. As long as a model supports skills, you can use Hf Cloud Python Env Setup with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Hf Cloud Python Env Setup AI skill free?

Yes. It is published on GitHub by huggingface under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇