DrewThomasson / ebook2audiobook

Generates an audiobook with chapters and ebook metadata using Calibre and Xtts from Coqui tts, and with optional voice cloning, and supports multiple languages
MIT License
795 stars 78 forks source link

ModuleNotFoundError: No module named 'pyaudioop' #42

Closed FuriFull closed 4 days ago

FuriFull commented 4 days ago

Hello, tried to run app.py and got this error:

c:\Audiobooks>python app.py
starting...
Traceback (most recent call last):
  File "c:\Audiobooks\pydub\utils.py", line 14, in <module>
    import audioop
ModuleNotFoundError: No module named 'audioop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Audiobooks\app.py", line 91, in <module>
    from pydub import AudioSegment
  File "c:\Audiobooks\pydub\__init__.py", line 1, in <module>
    from .audio_segment import AudioSegment
  File "c:\Audiobooks\pydub\audio_segment.py", line 11, in <module>
    from .utils import mediainfo_json, fsdecode
  File "c:\Audiobooks\pydub\utils.py", line 16, in <module>
    import pyaudioop as audioop
ModuleNotFoundError: No module named 'pyaudioop'

Tried python from 3.11 to 3.9 - results are the same

ROBERT-MCDOWELL commented 4 days ago

pip install pyaudio. better to run virtual env 3.11

DrewThomasson commented 4 days ago

Have you tried doing

pip install pydub --upgrade

To see if that fixes it? 🤔

What's weird is audioop should be a built-in module for python

FuriFull commented 4 days ago

Now it's regex error

c:\Audiobooks>python app.py
starting...
Traceback (most recent call last):
  File "c:\Audiobooks\app.py", line 94, in <module>
    import nltk
  File "c:\Audiobooks\nltk\__init__.py", line 138, in <module>
    from nltk.text import *
  File "c:\Audiobooks\nltk\text.py", line 30, in <module>
    from nltk.tokenize import sent_tokenize
  File "c:\Audiobooks\nltk\tokenize\__init__.py", line 66, in <module>
    from nltk.tokenize.casual import TweetTokenizer, casual_tokenize
  File "c:\Audiobooks\nltk\tokenize\casual.py", line 49, in <module>
    import regex  # https://github.com/nltk/nltk/issues/2409
  File "c:\Audiobooks\regex\__init__.py", line 1, in <module>
    from .regex import *
  File "c:\Audiobooks\regex\regex.py", line 417, in <module>
    import regex._regex_core as _regex_core
  File "c:\Audiobooks\regex\_regex_core.py", line 21, in <module>
    import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'
DrewThomasson commented 4 days ago

Something is wrong with your python env just use miniconda to make python envs

or just use the docker (easiest solution)

🐳 Using Docker

You can also use Docker to run the eBook to Audiobook converter. This method ensures consistency across different environments and simplifies setup.

🚀 Running the Docker Container

To run the Docker container and start the Gradio interface, use the following command:

-Run with CPU only

docker run -it --rm -p 7860:7860 --platform=linux/amd64 athomasson2/ebook2audiobookxtts:huggingface python app.py

-Run with GPU Speedup (Nvida graphics cards only)

docker run -it --rm --gpus all -p 7860:7860 --platform=linux/amd64 athomasson2/ebook2audiobookxtts:huggingface python app.py

This command will start the Gradio interface on port 7860.(localhost:7860)

FuriFull commented 4 days ago

Yeah, thx, docker is fine, works well.