DrewThomasson / ebook2audiobookXTTS

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
633 stars 69 forks source link

can't run app.py #36

Open cavalrymargarine0x1 opened 2 hours ago

cavalrymargarine0x1 commented 2 hours ago

hello, i'm trying to run app.py, but this is what the terminal outputs:

C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS>python app.py
starting...
Traceback (most recent call last):
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\app.py", line 94, in <module>
    import nltk
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\nltk\__init__.py", line 138, in <module>
    from nltk.text import *
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\nltk\text.py", line 30, in <module>
    from nltk.tokenize import sent_tokenize
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\nltk\tokenize\__init__.py", line 66, in <module>
    from nltk.tokenize.casual import TweetTokenizer, casual_tokenize
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\nltk\tokenize\casual.py", line 49, in <module>
    import regex  # https://github.com/nltk/nltk/issues/2409
    ^^^^^^^^^^^^
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\regex\__init__.py", line 1, in <module>
    from .regex import *
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\regex\regex.py", line 417, in <module>
    import regex._regex_core as _regex_core
  File "C:\windows-python3.10-ebook2audiobookxtts\ebook2audiobookXTTS\regex\_regex_core.py", line 21, in <module>
    import regex._regex as _regex
ModuleNotFoundError: No module named 'regex._regex'

i've followed all the installation steps, and made sure the regex module is installed after reading the issue the terminal references but same result. would you know how to fix this? thank you

DrewThomasson commented 2 hours ago

what does running the command

python -m pip show regex

give you?

DrewThomasson commented 2 hours ago

Try:

python -m pip install regex -v; python -m pip show regex; python -c "import regex; print('regex imported successfully')"

What happens?

cavalrymargarine0x1 commented 1 hour ago

what does running the command

python -m pip show regex

give you?

Name: regex
Version: 2024.9.11
Summary: Alternative regular expression module, to replace re.
Home-page: https://github.com/mrabarnett/mrab-regex
Author: Matthew Barnett
Author-email: regex@mrabarnett.plus.com
License: Apache Software License
Location: c:\users\cavalry\appdata\local\programs\python\python312\Lib\site-packages
Requires:
Required-by: dateparser, nltk, transformers

Try:

python -m pip install regex -v; python -m pip show regex; python -c "import regex; print('regex imported successfully')"

What happens?


Usage:
  c:\users\cavalry\appdata\local\programs\python\python312\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...
  c:\users\cavalry\appdata\local\programs\python\python312\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...
  c:\users\cavalry\appdata\local\programs\python\python312\python.exe -m pip install [options] [-e] <vcs project url> ...
  c:\users\cavalry\appdata\local\programs\python\python312\python.exe -m pip install [options] [-e] <local project path> ...
  c:\users\cavalry\appdata\local\programs\python\python312\python.exe -m pip install [options] <archive url/path> ...

no such option: -;
cavalrymargarine0x1 commented 1 hour ago

i've also:

same result

ROBERT-MCDOWELL commented 1 hour ago

ebook2audiobook is not compatible with 3.12 and 3.13 since all major A.I. engine which eb2ab depends runs < 3.12 unless very few exceptions. you must for now install a python virtual env version 3.10 or 3.11. or wait the new release as an installer will do that for you

DrewThomasson commented 1 hour ago

@cavalrymargarine0x1

so yeah, Right now were working on getting to out version 2.0 which will be a lot easer to install.

In the meantime you can run it in the docker version:

🐳 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)