Troubleshooting¶
Common issues and solutions when using Power CLI.
Installation Issues¶
Command not found: power¶
Symptom: Running power gives "command not found" error.
Solutions:
-
Ensure the package is installed:
-
Check if pip scripts are in your PATH:
-
Try reinstalling with pipx:
Import errors¶
Symptom: ModuleNotFoundError: No module named 'pptx'
Solution: Install missing dependencies:
Or reinstall the package:
Template Issues¶
Template file not found¶
Symptom: Error: Invalid value for '-t' / '--template': Path 'template.pptx' does not exist.
Solutions:
-
Check the file path:
-
Use absolute path:
-
Check current directory:
Layout not found¶
Symptom: Layout specified in YAML doesn't work.
Solution: Inspect the template to see available layouts:
Use the exact layout name from the output:
Placeholder index error¶
Symptom: Warning: Could not fill placeholder 10: ...
Solution: 1. Find valid placeholder indices:
- Use the correct index in your YAML:
YAML Issues¶
YAML parsing errors¶
Symptom: Error: while parsing a block mapping
Common causes:
-
Incorrect indentation:
-
Missing quotes around special characters:
-
Tab characters (use spaces instead):
Chart data mismatch¶
Symptom: Chart looks wrong or error about data length.
Solution: Ensure series values match categories count:
# Wrong - 4 categories but 3 values
categories: [Q1, Q2, Q3, Q4]
series:
Revenue: [100, 200, 300] # Missing one value!
# Correct
categories: [Q1, Q2, Q3, Q4]
series:
Revenue: [100, 200, 300, 400]
File Issues¶
Permission denied¶
Symptom: Error: Permission denied: output.pptx
Solutions:
- Close the file if it's open in PowerPoint
- Check file permissions:
- Try a different output path:
File is corrupted¶
Symptom: PowerPoint can't open the generated file.
Solutions:
- Check for errors during generation
- Verify template isn't corrupted:
- Try without a template:
Image not found¶
Symptom: FileNotFoundError: Image not found: images/photo.png
Solutions:
-
Use absolute paths:
-
Paths are relative to where you run the command:
-
Check the file exists:
Common Errors¶
Slide index out of range¶
Symptom: Error: Slide index 5 out of range
Solution: Check slide count first:
Invalid replacement format¶
Symptom: Error: Invalid replacement format: name (expected KEY=VALUE)
Solution: Use the correct format:
# Wrong
power replace deck.pptx name John -o out.pptx
# Correct
power replace deck.pptx NAME=John -o out.pptx
JSON output parsing¶
Symptom: JSON output contains extra characters.
Solution: Use --json flag properly:
# For piping to jq
power inspect template.pptx --json | jq '.layouts'
# For saving to file
power inspect template.pptx --json > info.json
Performance Issues¶
Slow generation with many images¶
Solutions:
-
Optimize images before embedding:
-
Use compressed formats (JPEG for photos)
-
Process in batches for large presentations
Memory errors with large templates¶
Solution: Use simpler templates or split into multiple presentations.
Getting Help¶
If you can't resolve an issue:
-
Check the GitHub Issues
-
Create a new issue with:
- Power CLI version (
power --version) - Python version (
python --version) - Operating system
- Complete error message
-
Minimal YAML to reproduce
-
Include relevant files (sanitized of sensitive data)
Debug Mode¶
For detailed error information, run Python directly:
from power import PowerPresentation
import traceback
try:
ppt = PowerPresentation(template="template.pptx")
# ... operations
except Exception as e:
traceback.print_exc()
See Also¶
- Installation - Setup guide
- YAML Format - Specification reference
- Commands - CLI reference