DrewThomasson/ebook2audiobook

I getting error when pip installing TTS

Closed this issue · 13 comments

Hey,

i am getting error while trying to install TTS. I tried differnt python version, also in venv environment, i installed spacey spearately, i checken my c++ compiler is working. can you help me ? I am using windows .

  Compiling spacy/matcher/matcher.pyx because it changed.
  Compiling spacy/matcher/phrasematcher.pyx because it changed.
  Compiling spacy/matcher/dependencymatcher.pyx because it changed.
  Compiling spacy/symbols.pyx because it changed.
  Compiling spacy/vectors.pyx because it changed.
  [ 1/41] Cythonizing spacy/attrs.pyx
  [ 2/41] Cythonizing spacy/kb.pyx
  Traceback (most recent call last):
    File "C:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\youba\AppData\Local\Temp\pip-build-env-tlncvz06\overlay\Lib\site-packages\setuptools\build_meta.py", line 332, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "C:\Users\youba\AppData\Local\Temp\pip-build-env-tlncvz06\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires
      self.run_setup()
    File "C:\Users\youba\AppData\Local\Temp\pip-build-env-tlncvz06\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
      exec(code, locals())
    File "<string>", line 224, in <module>
    File "<string>", line 211, in setup_package
    File "C:\Users\youba\AppData\Local\Temp\pip-build-env-tlncvz06\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "C:\Users\youba\AppData\Local\Temp\pip-build-env-tlncvz06\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: spacy/kb.pyx
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
PS D:\python>

Make sure your installing it into a python 3.10 env (python < 3.11 --> #28 (comment)), Thats the only one I can verify that works,

  • I thinker higher versions like python 12 break tts

Heres the TTS GitHub repo to check if your issue exists in their issues page:
https://github.com/coqui-ai/TTS

Or Just use the Docker install, its a lot easier

  • Then you don't have to deal with any of these dependency issues

coqui-tts is (still) not compatible with python > 3.11

for now you cannot install ebook2audiobookXTTS with pip install since I'm working and fixing some last glitches on the requirements.txt and setup.py (not yet released)
so if you want to run python app.py directly you must:

  • install calibre and ffmpeg from your OS package application or from sources if you like to compile.

Centos/Fedora/Redhat
dnf install -y calibre ffmpeg

Ubuntu/Debian
apt-get install -y calibre ffmpeg

  • create a python virtual env:

conda create --prefix /path/to/env/folder python=3.11
conda activate /path/to/env/folder

  • install the following packages:

pip install pydub nltk beautifulsoup4 ebooklib coqui-tts tqdm mecab mecab-python3 unidic gradio

  • you need at least a unidic dictionary

python -m unidic download

  • run the app
    python app.py

#28 (comment)

Thx for the extra info @ROBERT-MCDOWELL 🙌

Also if you plan on using multiple Python env's I would recommend installing something like Miniconda so you can handle multiple python env's at the same time

@DrewThomasson
you're welcome. pls do not modify your repo for now as I'm refactoring your code and discovered
hard incompatibility between calibre library versions and python env installed compatible with coqui-tts causing code break. (I'm talking about native run of ebook2audiobook in a python virtual env only).

@DrewThomasson you're welcome. pls do not modify your repo for now as I'm refactoring your code and discovered hard incompatibility between calibre library versions and python env installed compatible with coqui-tts causing code break. (I'm talking about native run of ebook2audiobook in a python virtual env only).

kk I'll put changes on hold for now lol,

if your changes concerns other than app.py so it's ok. if it's not big changes on app.py so you can do it to and will update it on my side too

@NeverBeLazyG

I think i solved your pip install issue btw

I updated the readme with the new tts pip install

  • That is the new pip install that's still being updated :)
  • Tested on my windows computer and now I no longer get the error you were getting with spacy :)

use this instead

pip install coqui-tts==0.24.2 pydub nltk beautifulsoup4 ebooklib tqdm gradio==4.44.0

python -m nltk.downloader punkt
python -m nltk.downloader punkt_tab
pip install coqui-tts==0.24.2 pydub nltk beautifulsoup4 ebooklib tqdm gradio==4.44.0

python -m nltk.downloader punkt
python -m nltk.downloader punkt_tab

This command can work, unlike the current README.md command

?

I thought I just updated the readme to have that instead like 9 hours ago?

Is it not showing on your end?

I encountered the following error previously due to unknown circumstances:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pylint 2.17.1 requires dill>=0.2; python_version < "3.11", which is not installed.
xformers 0.0.20 requires torch==2.0.1, but you have torch 2.5.0 which is incompatible.

However, the system is now functioning normally. The instructions in the README.md file are correct and up-to-date

Good enough lol

What are you also pasting the mecab install commands in for non-Latin languages?

Idk why I'm not getting that error when I paste

pip install coqui-tts==0.24.2 pydub nltk beautifulsoup4 ebooklib tqdm gradio==4.44.0

python -m nltk.downloader punkt
python -m nltk.downloader punkt_tab

into my windows 10 powershell in a python 3.10 env

@dedh121224

Also thanks for the update, good to hear that its finally working locally for windows users 👍

@NeverBeLazyG

I think i solved your pip install issue btw

I updated the readme with the new tts pip install

  • That is the new pip install that's still being updated :)
  • Tested on my windows computer and now I no longer get the error you were getting with spacy :)

use this instead

pip install coqui-tts==0.24.2 pydub nltk beautifulsoup4 ebooklib tqdm gradio==4.44.0

python -m nltk.downloader punkt
python -m nltk.downloader punkt_tab

Thanks man 👍