본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트7.8k · #12963

python-spreadsheet-debug

하는 일

이 스킬은 Python 스프레드시트 작업을 위한 순서 있는 점검 방법을 AI 에이전트에게 줍니다. 스프레드시트 스크립트가 실패할 때 문제가 설정인지 스크립트인지 알아내려는 사람에게 맞습니다.

사용하는 경우

  • ✓스프레드시트 스크립트가 실패하고 셸 출력을 읽기 어려울 때.
  • ✓Python이나 라이브러리가 없거나 버전이 맞지 않을 수 있다고 의심될 때.
  • ✓전체 작업 전에 파일을 읽을 수 있는지 작은 테스트 실행으로 확인하고 싶은 경우.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/python-spreadsheet-debug/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/python-spreadsheet-debug/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 스프레드시트 스크립트가 분명한 이유 없이 실패합니다. Python과 pandas가 작동하는지 확인하고 파일 읽기를 테스트해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 사용하는 Python과 버전을 확인하고, 필요한 라이브러리를 하나씩 가져와 봅니다. 그다음 파일을 읽고 요약을 출력하는 짧은 테스트 스크립트를 전체 작업 전에 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Python Spreadsheet Debugging Workflow

When executing Python scripts for spreadsheet/data processing tasks, use this systematic debugging approach to efficiently isolate environment configuration issues from script logic errors, especially when run_shell returns opaque errors.

Step 1: Verify Python Environment

First, confirm the Python interpreter path and version to ensure you're working in the expected environment:

which python python3
python --version
python3 --version

This identifies whether Python is available and which version is being used.

Step 2: Test Library Imports in Isolation

Before running your full script, verify that required libraries can be imported successfully. Test each critical import individually:

python -c "import pandas; print('pandas:', pandas.__version__)"
python -c "import openpyxl; print('openpyxl:', openpyxl.__version__)"
python -c "import xlrd; print('xlrd:', xlrd.__version__)"

Replace library names based on your script's requirements. This identifies missing dependencies or version conflicts early.

Step 3: Run Minimal Test Script

Create and execute a minimal script that exercises only the core functionality without full business logic:

# test_minimal.py
import pandas as pd

# Test 1: Can we read a file?
try:
    df = pd.read_excel('sample.xlsx')
    print(f"✓ File read successful: {len(df)} rows")
except Exception as e:
    print(f"✗ File read failed: {e}")

# Test 2: Can we perform basic operations?
try:
    result = df.groupby('category')['amount'].sum()
    print(f"✓ GroupBy operation successful")
except Exception as e:
    print(f"✗ Operation failed: {e}")

Run this with: python test_minimal.py

Purpose: This isolates whether the issue is with file access, library functionality, or specific script logic.

Step 4: Execute Full Script

Once the minimal test passes, run the complete script:

python your_script.py

If errors occur now, you know the environment is correctly configured and can focus on debugging the specific logic.

Quick Diagnostic Command

For rapid diagnosis, run all checks in sequence:

echo "=== Python Version ===" && python --version && \
echo "=== Key Imports ===" && python -c "import pandas, openpyxl; print('OK')" && \
echo "=== Ready for full script ==="

Common Issues and Resolutions

Symptom Likely Cause Resolution
ModuleNotFoundError Missing package pip install <package-name>
ImportError with version Version conflict Check pip list, reinstall specific version
FileNotFoundError Wrong path/context Verify working directory with pwd
PermissionError File access Check file permissions or path

When to Use This Pattern

  • run_shell returns cryptic or truncated error messages
  • Script worked previously but suddenly fails
  • Deploying to a new environment or container
  • Debugging spreadsheet processing with pandas, openpyxl, xlrd, etc.

Benefits

  • Fast isolation: Identifies environment vs. logic issues within seconds
  • Incremental confidence: Each passing step narrows the problem space
  • Reusable pattern: Apply consistently across all Python spreadsheet tasks
자주 묻는 질문

라이브러리를 하나씩 가져와 보는 이유는 무엇인가요?

어떤 라이브러리가 없거나 고장 났는지 정확히 보여 주어, 고치기가 더 빠릅니다.

최소 테스트 스크립트는 무엇을 하나요?

스프레드시트를 읽고 행 수를 출력해, 기본 작업이 작동하는지 확인합니다.

Excel 파일에만 적용되나요?

아닙니다. 이 단계는 CSV 파일과 다른 표 형식 데이터에도 적용됩니다.

상세 정보

작성자의 원본 설명

Systematic Python debugging workflow for spreadsheet tasks to isolate environment issues from script logic

repo: HKUDS/AgentPilot

인기도

GitHub 스타
7.8k
순위
#12963
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬