Skip to main content
SwissKnife relies on several external dependencies for various file conversion operations. This guide covers installation instructions for all required and optional dependencies.

Core Python Dependencies

SwissKnife requires Python 3.13 or higher and several Python packages:
1

Clone the repository

git clone https://github.com/naineel1209/swissknife.git
cd swissknife
2

Install UV package manager

pip install uv --upgrade
3

Sync dependencies

uv sync
4

Activate virtual environment

source .venv/bin/activate

Manual Installation

If you prefer to install dependencies manually:
uv add pypandoc pillow imageio-ffmpeg patoolib google-genai

Python Package Overview

  • pypandoc - Universal document converter (requires Pandoc)
  • python-docx - Microsoft Word document handling
  • pdfplumber - PDF text extraction and analysis
  • openpyxl - Excel file processing
  • pypdf - PDF manipulation for merge/split operations
  • Pillow (PIL) - Image processing and conversion
  • imageio-ffmpeg - Video and audio conversion backend (includes FFmpeg binary)
  • pydub - Audio manipulation and format conversion
  • moviepy - Video editing and processing
  • patoolib - Universal archive extraction and creation
  • google-genai - Google Gemini AI integration for text summarization and analysis
  • argparse - Command-line interface parsing
  • pathlib - Modern path handling
  • tempfile - Temporary file management
  • subprocess - External process execution

LaTeX Installation

LaTeX is required for PDF conversion from document formats. If you only work with images, audio, video, or archives, you can skip this section.
PDF conversion from documents requires a LaTeX distribution. Choose the appropriate installation for your operating system:
1

Download MiKTeX

Visit miktex.org and download the installer
2

Run the installer

Follow the setup wizard with default options
3

Automatic package installation

MiKTeX will automatically install required LaTeX packages on-demand during first use

TeX Live (Alternative)

If you have Chocolatey package manager installed:
choco install texlive

Archive Tools

Some archive formats require external command-line tools for extraction and creation.

7-Zip (.7z format)

Required for handling 7-Zip archives:
Ubuntu/Debian:
sudo apt update
sudo apt install p7zip-full
This installs the 7z command-line utility with full compression and extraction support.

RAR (.rar format)

Required for handling RAR archives:
Ubuntu/Debian:
sudo apt update
sudo apt install unrar rar
  • unrar - For extraction only
  • rar - For both creation and extraction

Verifying Installation

After installing dependencies, verify they are correctly configured:
# Check Python version
python --version

# Verify key packages
python -c "import pypandoc; print('pypandoc OK')"
python -c "import PIL; print('Pillow OK')"
python -c "import google.genai; print('google-genai OK')"

Troubleshooting

Error: FileNotFoundError: [Errno 2] No such file or directory: 'xelatex'Solution:
  • Ensure LaTeX is installed following the instructions above
  • Verify LaTeX is in your PATH by running pdflatex --version
  • Restart your terminal after installation
Error: Archive extraction failed or Command not found: 7zSolution:
  • Install the appropriate archive tool for your OS
  • Verify the tool is in your PATH
  • On Windows, ensure you’ve added the installation directory to PATH and restarted your terminal
Error: ModuleNotFoundError: No module named 'pypandoc'Solution:
  • Ensure you’ve activated the virtual environment: source .venv/bin/activate
  • Re-run uv sync or manually install missing packages
  • Verify you’re using the correct Python interpreter
Error: FFmpeg not found or media conversion failsSolution:
  • The imageio-ffmpeg package includes FFmpeg binary automatically
  • Reinstall: uv add imageio-ffmpeg --force
  • Verify installation: python -c "import imageio_ffmpeg; print(imageio_ffmpeg.get_ffmpeg_exe())"

Build docs developers (and LLMs) love