Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error cythonizing spacy on pip install TTS #269

Closed
rafferty90 opened this issue Oct 9, 2024 · 14 comments · Fixed by #274
Closed

Error cythonizing spacy on pip install TTS #269

rafferty90 opened this issue Oct 9, 2024 · 14 comments · Fixed by #274
Assignees
Labels
bug Something isn't working

Comments

@rafferty90
Copy link

pip install TTS thows the error "Cython.Compiler.Errors.CompileError: spacy/kb.pyx" (spacy-3.0.6.tar.gz). Any thoughts on how to resolve this? :)

error1
error3

@Drivez
Copy link

Drivez commented Oct 11, 2024

I get the same error when trying to install

@aedocw aedocw self-assigned this Oct 11, 2024
@aedocw
Copy link
Owner

aedocw commented Oct 11, 2024

What platform? Which version of python?

I haven't done a clean install in ages but I'm trying now (so far its going fine but also taking ages to download so many versions of transformers!!)

@Drivez
Copy link

Drivez commented Oct 11, 2024

Im on Mac using a dev container with python 3.11

@rafferty90
Copy link
Author

Mine is windows 10, python 3.11. I do not have a dedicated gpu so I have opted and successfully used the edge-tts version. Very happy with the results. This being my first tts project. I have learnt a lot. @aedocw if you have any insights on how to solve this, this will be great.

@aedocw
Copy link
Owner

aedocw commented Oct 11, 2024

I had a successful TTS install on a mac, in a virtual environment, with Python 3.11.2. It took a long time.

I'm running a fresh install of TTS on an Ubuntu 22 machine with Python 3.10.12, so far it's going OK but also taking ages...

UPDATE: install on Ubuntu 22.04 with python 3.10.12 took forever but finished successfully.

Both installs were in brand new virtual environments (python -m venv test; source test/bin/activate)

@Drivez
Copy link

Drivez commented Oct 15, 2024

UPDATE: i tested this on another Mac not using the M chips and it worked fine, so maybe something there? or something other our local machines

@aedocw
Copy link
Owner

aedocw commented Oct 19, 2024

I just recreated this error on a clean Ubuntu 24.04 system with python 3.11.10 in a venv. Damn :(

I'll see if I can figure out why, but if anyone has ideas or sorts this out, please share, thanks!

@aedocw
Copy link
Owner

aedocw commented Oct 19, 2024

I think this fixed it for me: pip install -r requirements.txt --only-binary spacy

Before that, in the same venv, I ran pip install spacy --only-binary spacy, but I think you can just use the first thing alone to tell pip to install everything in requirements, but only install binary of spacy instead of trying to compile locally.

@nowjon
Copy link

nowjon commented Oct 20, 2024

I think this fixed it for me: pip install -r requirements.txt --only-binary spacy

Before that, in the same venv, I ran pip install spacy --only-binary spacy, but I think you can just use the first thing alone to tell pip to install everything in requirements, but only install binary of spacy instead of trying to compile locally.

Windows 11, Python 3.11.9
I attempted these commands, still getting this error

(.venv) PS C:\users\Jon\Development\epub2tts> pip install .
Processing c:\users\jon\development\epub2tts
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting beautifulsoup4 (from epub2tts==2.6.0)
Using cached beautifulsoup4-4.12.3-py3-none-any.whl.metadata (3.8 kB)
Collecting deepspeed (from epub2tts==2.6.0)
Using cached deepspeed-0.15.2.tar.gz (1.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
[WARNING] Unable to import torch, pre-compiling ops will be disabled. Please visit https://pytorch.org/ to see how to properly install torch on your system.
←[93m [WARNING] ←[0m unable to import torch, please install it if you want to pre-compile any deepspeed ops.
DS_BUILD_OPS=1
Traceback (most recent call last):
File "C:\users\Jon\Development\epub2tts.venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\users\Jon\Development\epub2tts.venv\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:\users\Jon\Development\epub2tts.venv\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\Jon\AppData\Local\Temp\pip-build-env-gxmv78xd\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\Jon\AppData\Local\Temp\pip-build-env-gxmv78xd\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires
self.run_setup()
File "C:\Users\Jon\AppData\Local\Temp\pip-build-env-gxmv78xd\overlay\Lib\site-packages\setuptools\build_meta.py", line 516, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\Jon\AppData\Local\Temp\pip-build-env-gxmv78xd\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup
exec(code, locals())
File "", line 156, in
AssertionError: Unable to pre-compile ops without torch installed. Please install torch before attempting to pre-compile ops.
[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.

@onura46
Copy link

onura46 commented Oct 25, 2024

The TTS library used by this repo isn't supported anymore. People are having similar issues over there, so I expect the problems are similar here. They recommend switching to coqui-tts where it's being maintained now.

@aedocw
Copy link
Owner

aedocw commented Oct 27, 2024

I'm trying with this repo, replacing TTS with coqui-tts in requirements. Will follow up with how that goes.

@aedocw aedocw added the bug Something isn't working label Oct 27, 2024
@aedocw
Copy link
Owner

aedocw commented Oct 27, 2024

Thanks to @onura46 I think the fix was switching to a new repo for coqui! Merging update to requirements now, users experiencing failed installs can try pip install . --upgrade --force-reinstall --only-binary spacy after pulling the branch switch-tts. Feedback welcome!

EDIT: Not so fast, this didn't solve things for me. Might try with python3.10, as seen in some other bug reports.

@aedocw
Copy link
Owner

aedocw commented Oct 27, 2024

This worked with this branch and Python 3.11 in a clean venv:

pip install coqui-tts --only-binary spacy
pip install .

I'll update instructions, I think it's fixed! Folks who have had problems, please try and let me know how it works for you.

@aedocw aedocw linked a pull request Oct 27, 2024 that will close this issue
@danielw97
Copy link

Thanks a bunch for this.
Whilst I wasn't having this particular problem, I was seeing some dependency issues with the old unmaintained version of tts.
This particular fork is actively being contributed to it seems as well which is a big help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants