Skip to content

Conversation

@avinashvarna
Copy link

  • Removed dependency on numpy.distutils to allow installation on python >=3.12 (fixes numpy.distutils deprecated #312)
  • Added Github workflow to build/install and run tests (using pytest) on Ubuntu w/ python 3.11, 3.12 and 3.13

@curlysasha
Copy link

working! thanks

@amrutadotorg
Copy link

Installing Aeneas on Python 3.12+ (macOS)

A simple guide for installing aeneas with Python 3.12+ support, including the fixes from PR #317.

Prerequisites

  1. Install Homebrew (if not already installed):

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install system dependencies:

    brew install espeak ffmpeg
  3. Create a Python virtual environment (recommended):

    python3.12 -m venv ~/aeneas_env
    source ~/aeneas_env/bin/activate

Installation Steps

Step 1: Clone the PR #317 Branch

cd ~/Downloads  # or wherever you want to install
git clone -b py312_support https://github.com/avinashvarna/aeneas.git
cd aeneas

Step 2: Upgrade Python Build Tools

pip install --upgrade pip setuptools packaging numpy

Step 3: Set Environment Variables

export LDFLAGS="-L/opt/homebrew/opt/espeak/lib -L/opt/homebrew/lib"
export CPPFLAGS="-I/opt/homebrew/opt/espeak/include -I/opt/homebrew/include"

Step 4: Disable Festival Extension (Optional)

Festival is rarely needed. To skip it and avoid compilation errors:

# Backup original setup.py
cp setup.py setup.py.bak

# Comment out Festival extension
sed -i.tmp '38,54s/^/#/' setup.py
sed -i.tmp '61s/^/#/' setup.py

Step 5: Install Aeneas

pip install .

Step 6: Verify Installation

# Move out of source directory first!
cd ~
python -m aeneas.diagnostics

You should see:

[INFO] aeneas.cdtw    AVAILABLE
[INFO] aeneas.cmfcc   AVAILABLE
[INFO] aeneas.cew     AVAILABLE
[INFO] All required dependencies are met

Fix Shell Encoding Warning (Optional)

Add to your ~/.zshrc or ~/.bash_profile:

export PYTHONIOENCODING=UTF-8

Then reload:

source ~/.zshrc  # or source ~/.bash_profile

Quick Test

# Create a test directory
mkdir -p ~/aeneas_test && cd ~/aeneas_test

# Run example
python -m aeneas.tools.execute_task --example-cewsubprocess

Common Issues

Issue: "library 'espeak' not found"

Solution: Make sure environment variables are set before installing:

export LDFLAGS="-L/opt/homebrew/opt/espeak/lib -L/opt/homebrew/lib"
export CPPFLAGS="-I/opt/homebrew/opt/espeak/include -I/opt/homebrew/include"
pip install .

Issue: "library 'Festival' not found"

Solution: Disable Festival extension (Step 4 above) - you don't need it.

Issue: C extensions show "NOT AVAILABLE"

Solution: You're probably in the source directory. Move to a different directory:

cd ~
python -m aeneas.diagnostics

Issue: Intel Mac vs Apple Silicon

For Intel Macs, use /usr/local instead of /opt/homebrew:

export LDFLAGS="-L/usr/local/opt/espeak/lib -L/usr/local/lib"
export CPPFLAGS="-I/usr/local/opt/espeak/include -I/usr/local/include"

Usage Example

Create align.py:

from aeneas.executetask import ExecuteTask
from aeneas.task import Task

# Configuration
config = "task_language=eng|is_text_type=plain|os_task_file_format=srt"

# Create task
task = Task(config_string=config)
task.audio_file_path_absolute = "/path/to/audio.mp4"
task.text_file_path_absolute = "/path/to/transcript.txt"
task.sync_map_file_path_absolute = "/path/to/output.srt"

# Execute
ExecuteTask(task).execute()
task.output_sync_map_file()
print("Done!")

Run with:

python align.py

Alternative: Command Line

python -m aeneas.tools.execute_task \
    audio.mp4 \
    transcript.txt \
    "task_language=eng|is_text_type=plain|os_task_file_format=srt" \
    output.srt

Credits

Notes

  • The original aeneas repository hasn't been updated since 2017
  • PR Changes for supporting newer python/numpy #317 is not merged but provides Python 3.12+ compatibility
  • Festival TTS is optional - espeak works great for most use cases
  • All C extensions (cew, cdtw, cmfcc, cwave) should compile and work

@amrutadotorg amrutadotorg mentioned this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants