Common Issues
Module not found errors
Module not found errors
Error Message:Cause:
SwissKnife dynamically imports modules based on the operation you’re performing. This error occurs when a required Python package is not installed in your environment (solution.py:12-26).Solutions:
-
Install the specific module mentioned in the error:
-
Install all core dependencies using UV (recommended):
-
Install dependencies manually:
pypandoc- Required for document conversionsPIL(install withpip install Pillow) - Required for image conversionsimageio_ffmpeg(install withpip install imageio-ffmpeg) - Required for audio/video conversionspatoolib- Required for archive operationsgoogle.genai(install withpip install google-generativeai) - Required for AI summarizationpypdf- Required for PDF merge/split operations
LaTeX/Pandoc installation issues
LaTeX/Pandoc installation issues
Error Message:orCause:
Document conversions (especially to/from PDF) require both Pandoc and LaTeX to be installed on your system (solution.py:113-116).Solutions:Linux/Ubuntu:macOS:Or install system-wide:
Install LaTeX
Windows:- Download MiKTeX from miktex.org
- Run the installer and follow the setup wizard
- MiKTeX will automatically install packages on-demand
Install Pandoc
After installing pypandoc, you may need to install Pandoc separately:- Windows: Download from pandoc.org
- Linux:
sudo apt install pandoc - macOS:
brew install pandoc
Verify Installation
ffmpeg/media conversion errors
ffmpeg/media conversion errors
Error Message:orCause:
Audio and video conversions use ffmpeg through the imageio-ffmpeg package (solution.py:69-80). The error occurs when ffmpeg is not properly installed or accessible.Solutions:
-
Ensure imageio-ffmpeg is installed:
This package bundles ffmpeg, so no separate installation is needed.
-
Verify the installation:
-
For unsupported codec errors:
- Some video formats may require specific codecs
- Try converting to a common format first (e.g., MP4)
- Use
--preserve-originalflag to keep the source file
- Audio: MP3, WAV, FLAC, AAC, OGG, M4A (solution.py:40, 75-78)
- Video: MP4, AVI, MKV, MOV, WMV, FLV, WEBM, GIF (solution.py:42, 71-74, 79-80)
Archive tool (7z, rar) not found
Archive tool (7z, rar) not found
Error Message:orCause:
Archive operations require external command-line tools for certain formats like macOS:Windows:macOS:Windows:Workaround:
If you can’t install these tools, convert to commonly supported formats:
.7z and .rar (solution.py:135-146).Solutions:Install 7-Zip (for .7z format)
Linux (Ubuntu/Debian):- Download from 7-zip.org
- Install and add to system PATH:
- Search “Edit the system environment variables”
- Add
C:\Program Files\7-Zipto Path variable
Install RAR/UnRAR (for .rar format)
Linux (Ubuntu/Debian):- Download from rarlab.com
- Extract to a folder (e.g.,
C:\Tools\RAR) - Add to system PATH
Verify Installation
.zip- Works without external tools.tar.gz- Works on most systems
API key errors for summarization
API key errors for summarization
Error Message:Cause:
The AI summarization feature requires a Google API key for Gemini AI (solution.py:164).Solutions:
-
Get an API key:
- Sign up at aistudio.google.com
- Create a new project
- Generate an API key
-
Set the environment variable:
Linux/macOS:
Windows (Command Prompt):Windows (PowerShell):
-
Verify the setup:
File size limit errors (100MB)
File size limit errors (100MB)
Error Message:Cause:
The AI summarization feature has a 100MB file size limit for processing (solution.py:165-166).Solutions:
-
Compress or optimize the file:
- For PDFs: Use a PDF compression tool
- For documents: Remove embedded images or media
- For images in PDFs: Reduce image quality
-
Extract text before summarizing:
-
Split the document:
-
Use a different file format:
- Convert to a more efficient format before summarizing
- Text-based formats (.txt, .md) are typically smaller
- The limit is enforced at solution.py:166
- File size is calculated as
file_size_mb = input_abs.stat().st_size / (1024 * 1024)
File processing timeout errors
File processing timeout errors
Error Message:Cause:
When using AI summarization, the file is uploaded to Google’s servers for processing. If processing takes longer than 5 minutes (300 seconds), it times out (solution.py:181).Solutions:
-
Reduce file size:
- Large files take longer to process
- Follow solutions in “File size limit errors” above
-
Check internet connection:
- Slow upload speeds can delay processing
- Ensure stable internet connectivity
-
Simplify the document:
- Complex formatting increases processing time
- Convert to plain text first:
-
Retry the operation:
- Temporary server issues may cause timeouts
- Wait a moment and try again
-
Use a shorter summary length:
- Timeout is set at 300 seconds (solution.py:181)
- The tool polls the processing status every 2 seconds (solution.py:182)
- Processing states:
PROCESSING→ACTIVE(success) orFAILED(error)
Permission errors
Permission errors
Error Messages:orCauses:
- Trying to write to a protected directory
- Output file is open in another program
- Insufficient file system permissions
-
Close the output file:
- Ensure the output file isn’t open in another application
- Close PDF readers, text editors, or media players
-
Check directory permissions:
-
Write to a different location:
-
Run with appropriate permissions:
-
Check input file permissions:
-
For Windows:
- Run Command Prompt or PowerShell as Administrator
- Right-click the application → “Run as administrator”
- Check if antivirus is blocking file access
Output file already exists
Output file already exists
Prompt:Cause:
SwissKnife prompts for confirmation before overwriting existing files to prevent accidental data loss (solution.py:63-65).Solutions:
-
Confirm overwrite:
- Type
yand press Enter to overwrite - Type
nor press Enter to cancel
- Type
-
Use a different output name:
-
Move or backup the existing file:
-
For batch operations:
- The tool will prompt for each file that exists
- Consider using a fresh output directory
- Or move existing files before starting
--preserve-original flag, the tool works on a temporary copy, so this only applies to the output file.Unsupported file type or conversion
Unsupported file type or conversion
Error Messages:orCause:
The file type is not recognized or the conversion path is not supported (solution.py:105-108).Solutions:
-
Check supported formats:
- Documents: PDF, DOCX, DOC, TXT, MD, EPUB, PPTX, XLSX, HTML, TEX, XML, and more (solution.py:36, 52)
- Images: JPG, JPEG, PNG, WEBP, GIF, BMP, TIFF, PDF (solution.py:38, 52)
- Audio: MP3, WAV, FLAC, AAC, OGG, M4A (solution.py:40, 52)
- Video: MP4, AVI, MKV, MOV, WMV, FLV, WEBM (solution.py:42, 52)
- Archives: ZIP, TAR, GZ, BZ2, 7Z, RAR (solution.py:44, 52)
-
Verify file extension:
- Ensure the file has the correct extension
- Rename if necessary:
mv file.unknown file.pdf
-
Try a two-step conversion:
-
Check if file is corrupted:
- Try opening the file in its native application
- Re-download or re-create the file if needed
- PDF to other document formats is not supported
- Some conversions require specific dependencies (see installation guide)
Batch conversion finds no files
Batch conversion finds no files
Message:Cause:
The batch conversion command couldn’t find any files with the specified input extension (solution.py:90).Solutions:
-
Verify the directory path:
-
Check extension format:
-
Verify file extensions:
-
Use absolute paths:
Getting Help
If you encounter an issue not covered here:- Check the error message carefully - It often contains the solution
- Run with verbose output - Use
-hor--helpflags - Verify all dependencies - Ensure required packages and tools are installed
- Check file permissions - Ensure you have read/write access
- Review the README - Installation instructions may have been missed