neonbjb / tortoise-tts

A multi-voice TTS system trained with an emphasis on quality
Apache License 2.0
12.54k stars 1.75k forks source link

Couldn't find a setup script in /tmp/easy_install-a8g3h_h2/scipy-1.14.0.tar.gz #799

Open Xeraster opened 3 weeks ago

Xeraster commented 3 weeks ago

I keep getting an installation error on the last step:

Processing dependencies for tortoise-tts==3.0.0
Searching for scipy
Reading https://pypi.org/simple/scipy/
Downloading https://files.pythonhosted.org/packages/4e/e5/0230da034a2e1b1feb32621d7cd57c59484091d6dccc9e6b855b0d309fc9/scipy-1.14.0.tar.gz#sha256=b5923f48cb840380f9854339176ef21763118a7300a88203ccd0bdd26e58527b
Best match: scipy 1.14.0
Processing scipy-1.14.0.tar.gz
error: Couldn't find a setup script in /tmp/easy_install-a8g3h_h2/scipy-1.14.0.tar.gz

How do I fix this? I followed the conda installation instructions step-by-step on Debian. I can't fix this error. Even if I try to manually copy that file to the tmp directory, the random folder name changes each time and it the installer wont touch it. How do we install this in Debian 12?

UPDATE: I found another fix from another thread tfix that one problem but then I ran into a series of other problems that I was ultimately unable to solve:

Processing dependencies for tortoise-tts==3.0.0
error: tokenizers 0.15.1 is installed but tokenizers!=0.11.3,<0.14,>=0.11.1 is required by {'transformers'}

I changed "tokenizers" to "tokenizers==0.11.1". The installation finally finishes but the program doesn't actually work. For example if I try "python tortoise/socket_server.py ", I get the following output:

Traceback (most recent call last):
  File "/media/hdd/documents_hdd/tortise-tts/tortoise-tts/tortoise/socket_server.py", line 1, in <module>
    import spacy
ModuleNotFoundError: No module named 'spacy'

so then I tried adding: 'spacy', to my setup.py file. Now I get this:

File "/media/hdd/documents_hdd/tortise-tts/tortoise-tts/tortoise/socket_server.py", line 4, in <module>
    from tortoise.api_fast import TextToSpeech
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/tortoise_tts-3.0.0-py3.9.egg/tortoise/api_fast.py", line 14, in <module>
    from tortoise.models.autoregressive import UnifiedVoice
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/tortoise_tts-3.0.0-py3.9.egg/tortoise/models/autoregressive.py", line 6, in <module>
    from transformers import GPT2Config, GPT2PreTrainedModel, LogitsProcessorList
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/transformers/__init__.py", line 26, in <module>
    from . import dependency_versions_check
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/transformers/dependency_versions_check.py", line 41, in <module>
    require_version_core(deps[pkg])
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/transformers/utils/versions.py", line 123, in require_version_core
    return require_version(requirement, hint)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/transformers/utils/versions.py", line 117, in require_version
    _compare_versions(op, got_ver, want_ver, requirement, pkg, hint)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/transformers/utils/versions.py", line 50, in _compare_versions
    raise ImportError(
ImportError: tokenizers>=0.11.1,!=0.11.3,<0.14 is required for a normal functioning of this module, but found tokenizers==0.15.1.
Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git main

Does anybody know how to fix this? How do I manually uninstall tokenizers 15? Where are those files stored? Can I manually installed these dependencies in conda? "pip install [package]" doesn't work.

ok so after trying a lot of different stuff, I think I finally tricked it into installing tokenizer 13.1. Now, running "python tortoise/socket_server.py" gets me this error:

File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_check/forward/fwdmain.py", line 515, in resolve_hint
    hint_resolved = eval(hint, decor_meta.func_wrappee_scope_forward)
  File "<string>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/media/hdd/documents_hdd/tortise-tts/tortoise-tts/tortoise/socket_server.py", line 4, in <module>
    from tortoise.api_fast import TextToSpeech
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/tortoise_tts-3.0.0-py3.9.egg/tortoise/api_fast.py", line 17, in <module>
    from tortoise.models.clvp import CLVP
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/tortoise_tts-3.0.0-py3.9.egg/tortoise/models/clvp.py", line 7, in <module>
    from tortoise.models.transformer import Transformer
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/tortoise_tts-3.0.0-py3.9.egg/tortoise/models/transformer.py", line 6, in <module>
    from rotary_embedding_torch import RotaryEmbedding
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/rotary_embedding_torch-0.6.3-py3.9.egg/rotary_embedding_torch/__init__.py", line 1, in <module>
    from rotary_embedding_torch.rotary_embedding_torch import (
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/rotary_embedding_torch-0.6.3-py3.9.egg/rotary_embedding_torch/rotary_embedding_torch.py", line 67, in <module>
    class RotaryEmbedding(Module):
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/rotary_embedding_torch-0.6.3-py3.9.egg/rotary_embedding_torch/rotary_embedding_torch.py", line 69, in RotaryEmbedding
    def __init__(
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/decorcache.py", line 77, in beartype
    return beartype_object(obj, conf)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/decorcore.py", line 87, in beartype_object
    _beartype_object_fatal(obj, conf=conf, **kwargs)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/decorcore.py", line 136, in _beartype_object_fatal
    beartype_nontype(obj, **kwargs)  # type: ignore[return-value]
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/_decornontype.py", line 188, in beartype_nontype
    return beartype_func(obj, **kwargs)  # type: ignore[return-value]
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/_decornontype.py", line 275, in beartype_func
    func_wrapper_code = generate_code(decor_meta)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/wrap/wrapmain.py", line 122, in generate_code
    code_check_params = _code_check_args(decor_meta)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/wrap/_wrapargs.py", line 346, in code_check_args
    reraise_exception_placeholder(
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_util/error/utilerrraise.py", line 137, in reraise_exception_placeholder
    raise exception.with_traceback(exception.__traceback__)
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_decor/wrap/_wrapargs.py", line 201, in code_check_args
    hint = sanify_hint_root_func(
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_check/convert/convsanify.py", line 131, in sanify_hint_root_func
    hint = decor_meta.func_arg_name_to_hint[pith_name] = coerce_func_hint_root(
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_check/convert/convcoerce.py", line 141, in coerce_func_hint_root
    hint = resolve_hint(
  File "/home/scott/miniconda3/envs/tortoise/lib/python3.9/site-packages/beartype-0.19.0rc0-py3.9.egg/beartype/_check/forward/fwdmain.py", line 628, in resolve_hint
    raise exception_cls(exception_message) from exception
beartype.roar.BeartypeDecorHintPep604Exception: Method rotary_embedding_torch.rotary_embedding_torch.RotaryEmbedding.__init__() parameter "custom_freqs" stringified PEP 604 type hint 'Tensor | None' syntactically invalid under Python < 3.10 (i.e., TypeError("unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'")). Consider either:
* Requiring Python >= 3.10. Abandon Python < 3.10 all ye who code here.
* Refactoring PEP 604 type hints into equivalent PEP 484 type hints: e.g.,
    # Instead of this...
    from __future__ import annotations
    def bad_func() -> int | str: ...

    # Do this. Ugly, yet it works. Worky >>>> pretty.
    from typing import Union
    def bad_func() -> Union[int, str]: ...

any help would be greatly appreciated.

EDIT AGAIN: Ok, disregard everything up to the spacy issue. Turns out I had things freally messed up and actually, the following issues is the furthest I got:

Traceback (most recent call last):
  File "/media/hdd/documents_hdd/tortise-tts/tortoise-tts/tortoise/socket_server.py", line 1, in <module>
    import spacy
ModuleNotFoundError: No module named 'spacy'

can someone please post up to date installation instructions? The conda one 100% does not work, at least on Debian and neither does the single-line pip command because Debian doesn't let you use pip that way, then if I try to set up a python venv, I just get a torrent of cryptic errors and its hard to tell what it even wants.

rsxdalv commented 2 weeks ago

I think the README.md is incorrectly suggesting Python 3.9 in one place (in another place it suggests 3.10...). The error in your logs suggests using 3.10 here:

beartype.roar.BeartypeDecorHintPep604Exception: Method rotary_embedding_torch.rotary_embedding_torch.RotaryEmbedding.__init__() parameter "custom_freqs" stringified PEP 604 type hint 'Tensor | None' syntactically invalid under Python < 3.10 (i.e., TypeError("unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'")). Consider either:
* Requiring Python >= 3.10. Abandon Python < 3.10 all ye who code here.
donlbooth commented 1 week ago

I ran into this issue and it looks like scipy changed their install method with version 14, I was able to work around it by editing the setup.py to install the last ver. "scipy==1.13.1" under install_requires

the100rabh commented 4 days ago

I ran into this issue and it looks like scipy changed their install method with version 14, I was able to work around it by editing the setup.py to install the last ver. "scipy==1.13.1" under install_requires

The above did work for me, but I got stuck with another

Installed /home/the100rabh/.conda/envs/tortoise/lib/python3.9/site-packages/safetensors-0.4.3-py3.9-linux-x86_64.egg
error: tokenizers 0.19.1 is installed but tokenizers!=0.11.3,<0.14,>=0.11.1 is required by {'transformers'}

Seems like there are several dependencies for me which are causing conflict. Any thoughts on what I can do to get this running. Sorry I am a n00b with python and pip configuration management.

donlbooth commented 4 days ago

For that one I changed it to 'tokenizers==0.13.4.rc3', since that was the last version <0.14