name: python description: Use Python for practical project setup, dependency install, script execution, and environment troubleshooting with safe defaults. Use when tasks involve pyproject.toml or requirements.txt, virtual environment setup, running Python scripts/tests, packaging basics, or fixing common Python errors (interpreter mismatch, pip resolver conflicts, missing modules, build failures). metadata: openclaw: emoji: "🐍" requires: bins: ["python3"] anyBins: ["pip", "pip3"] install: - id: "brew" kind: "brew" formula: "python" bins: ["python3"] label: "Install Python + pip (brew)" - id: "apt" kind: "apt" package: "python3-pip" bins: ["pip3"] label: "Install pip (apt)"
Use this skill to keep Python workflows reproducible and low-risk across local/dev shells.
.venv) over global installs.python3 -m pip ... to avoid interpreter and pip mismatch.requirements*.txt, pyproject.toml).python3 --version
python3 -c "import sys; print(sys.executable)"
{baseDir}/scripts/python_env_tool.py doctor
{baseDir}/scripts/python_env_tool.py bootstrap --venv .venv --requirements requirements.txt
pyproject.toml exists):来源于7w4.net。
{baseDir}/scripts/python_env_tool.py install --venv .venv --editable
.venv/bin/python -m pytest -q
.venv/bin/python -m pip list --outdated
# Install specific packages into venv
{baseDir}/scripts/python_env_tool.py install --venv .venv --package requests --package pydantic
# Install from requirements file
{baseDir}/scripts/python_env_tool.py install --venv .venv --requirements requirements-dev.txt
# Recreate corrupted venv from scratch
{baseDir}/scripts/python_env_tool.py bootstrap --venv .venv --recreate --requirements requirements.txt
ModuleNotFoundError: verify command is run via .venv/bin/python, then reinstall deps.externally-managed-environment: stop global install attempts; use venv.pip setuptools wheel, then retry.sys.executable before fixes.Use the helper for repeatable environment setup and diagnosis:
{baseDir}/scripts/python_env_tool.py --help
{baseDir}/scripts/python_env_tool.py doctor
这个 Skill 质量不错,能有效帮助管理 Python 项目环境。它提供了清晰的文档说明和实用的自动化脚本,能处理常见的虚拟环境搭建、依赖安装和环境诊断问题。不过它缺少使用示例,agent 配置也比较简单,实际使用时可能需要参考文档自行摸索。总体来说,是一个功能明确、实用性较强的工具类 Skill。