Closed tyrael0315 closed 4 months ago
I was able to get further by creating my own requirements file with the content:
spacy!=3.0.6
and then continue the installation with
pip install xtts-api-server -r req.txt
generally it tries to pull too many spacy versions probably best fixed with a more restrictive approach.
Afterwards it worked fine.
Confirm. It works for my Win 10 system.
Unfortunately it didn't seem to work for me while building a docker image
RUN pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
RUN pip install deepspeed
ADD https://raw.githubusercontent.com/daswer123/xtts-api-server/main/requirements.txt ./requirements.txt
RUN printf "\nspacy!=3.0.6" >> requirements.txt
RUN pip install xtts-api-server -r requirements.txt
I downloaded and appended spacy!=3.06 to the file but it still gave me the cython error while building.
Downloading spacy-3.0.5.tar.gz (7.0 MB)
260.6 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.0/7.0 MB 80.5 MB/s eta 0:00:00
261.1 Installing build dependencies: started
267.9 Installing build dependencies: finished with status 'done'
267.9 Getting requirements to build wheel: started
269.4 Getting requirements to build wheel: finished with status 'error'
269.5 error: subprocess-exited-with-error
269.5
269.5 × Getting requirements to build wheel did not run successfully.
269.5 │ exit code: 1
269.5 ╰─> [164 lines of output]
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 int length
269.5
269.5
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5
269.5
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:29:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:30:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 cpdef public object _lookups
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 cpdef public object _lookups
269.5 cpdef public object writing_system
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:32:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 cpdef public object _lookups
269.5 cpdef public object writing_system
269.5 cpdef public object get_noun_chunks
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:33:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cdef float prior_prob
269.5
269.5
269.5 cdef class KnowledgeBase:
269.5 cdef Pool mem
269.5 cpdef readonly Vocab vocab
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/kb.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5 Copied /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/setup.cfg -> /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/spacy/tests/package
269.5 Copied /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/pyproject.toml -> /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/spacy/tests/package
269.5 Cythonizing sources
269.5 Compiling spacy/training/example.pyx because it changed.
269.5 Compiling spacy/parts_of_speech.pyx because it changed.
269.5 Compiling spacy/strings.pyx because it changed.
269.5 Compiling spacy/lexeme.pyx because it changed.
269.5 Compiling spacy/vocab.pyx because it changed.
269.5 Compiling spacy/attrs.pyx because it changed.
269.5 Compiling spacy/kb.pyx because it changed.
269.5 Compiling spacy/ml/parser_model.pyx because it changed.
269.5 Compiling spacy/morphology.pyx because it changed.
269.5 Compiling spacy/pipeline/dep_parser.pyx because it changed.
269.5 Compiling spacy/pipeline/morphologizer.pyx because it changed.
269.5 Compiling spacy/pipeline/multitask.pyx because it changed.
269.5 Compiling spacy/pipeline/ner.pyx because it changed.
269.5 Compiling spacy/pipeline/pipe.pyx because it changed.
269.5 Compiling spacy/pipeline/trainable_pipe.pyx because it changed.
269.5 Compiling spacy/pipeline/sentencizer.pyx because it changed.
269.5 Downloading spacy-3.0.5.tar.gz (7.0 MB)
260.6 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.0/7.0 MB 80.5 MB/s eta 0:00:00
261.1 Installing build dependencies: started
267.9 Installing build dependencies: finished with status 'done'
267.9 Getting requirements to build wheel: started
269.4 Getting requirements to build wheel: finished with status 'error'
269.5 error: subprocess-exited-with-error
269.5
269.5 × Getting requirements to build wheel did not run successfully.
269.5 │ exit code: 1
269.5 ╰─> [164 lines of output]
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 int length
269.5
269.5
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5
269.5
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:29:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:30:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cdef class Vocab:
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 cpdef public object _lookups
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cdef Pool mem
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 cpdef public object _lookups
269.5 cpdef public object writing_system
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:32:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cpdef readonly StringStore strings
269.5 cpdef public Morphology morphology
269.5 cpdef public object vectors
269.5 cpdef public object _lookups
269.5 cpdef public object writing_system
269.5 cpdef public object get_noun_chunks
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/vocab.pxd:33:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5
269.5 Error compiling Cython file:
269.5 ------------------------------------------------------------
269.5 ...
269.5 cdef float prior_prob
269.5
269.5
269.5 cdef class KnowledgeBase:
269.5 cdef Pool mem
269.5 cpdef readonly Vocab vocab
269.5 ^
269.5 ------------------------------------------------------------
269.5
269.5 spacy/kb.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
269.5 Copied /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/setup.cfg -> /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/spacy/tests/package
269.5 Copied /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/pyproject.toml -> /tmp/pip-install-s0r1p60k/spacy_64f99793b9a745d2bbbfff7332c9c214/spacy/tests/package
269.5 Cythonizing sources
269.5 Compiling spacy/training/example.pyx because it changed.
269.5 Compiling spacy/parts_of_speech.pyx because it changed.
269.5 Compiling spacy/strings.pyx because it changed.
269.5 Compiling spacy/lexeme.pyx because it changed.
269.5 Compiling spacy/vocab.pyx because it changed.
269.5 Compiling spacy/attrs.pyx because it changed.
269.5 Compiling spacy/kb.pyx because it changed.
269.5 Compiling spacy/ml/parser_model.pyx because it changed.
269.5 Compiling spacy/morphology.pyx because it changed.
269.5 Compiling spacy/pipeline/dep_parser.pyx because it changed.
269.5 Compiling spacy/pipeline/morphologizer.pyx because it changed.
269.5 Compiling spacy/pipeline/multitask.pyx because it changed.
269.5 Compiling spacy/pipeline/ner.pyx because it changed.
269.5 Compiling spacy/pipeline/pipe.pyx because it changed.
269.5 Compiling spacy/pipeline/trainable_pipe.pyx because it changed.
269.5 Compiling spacy/pipeline/sentencizer.pyx because it changed.
269.5 Compiling spacy/pipeline/senter.pyx because it changed.
269.5 Compiling spacy/pipeline/tagger.pyx because it changed.
269.5 Compiling spacy/pipeline/transition_parser.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/arc_eager.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/ner.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/nonproj.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/_state.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/stateclass.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/transition_system.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/_beam_utils.pyx because it changed.
269.5 Compiling spacy/tokenizer.pyx because it changed.
269.5 Compiling spacy/training/align.pyx because it changed.
269.5 Compiling spacy/training/gold_io.pyx because it changed.
269.5 Compiling spacy/tokens/doc.pyx because it changed.
269.5 Compiling spacy/tokens/span.pyx because it changed.
269.5 Compiling spacy/tokens/token.pyx because it changed.
269.5 Compiling spacy/tokens/span_group.pyx because it changed.
269.5 Compiling spacy/tokens/graph.pyx because it changed.
269.5 Compiling spacy/tokens/morphanalysis.pyx because it changed.
269.5 Compiling spacy/tokens/_retokenize.pyx because it changed.
269.5 Compiling spacy/matcher/matcher.pyx because it changed.
269.5 Compiling spacy/matcher/phrasematcher.pyx because it changed.
269.5 Compiling spacy/matcher/dependencymatcher.pyx because it changed.
269.5 Compiling spacy/symbols.pyx because it changed.
269.5 Compiling spacy/vectors.pyx because it changed.
269.5 [ 1/41] Cythonizing spacy/attrs.pyx
269.5 [ 2/41] Cythonizing spacy/kb.pyx
269.5 Traceback (most recent call last):
269.5 File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
269.5 main()
269.5 File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
269.5 json_out['return_val'] = hook(**hook_input['kwargs'])
269.5 File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
269.5 return hook(config_settings)
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
269.5 return self._get_build_requires(config_settings, requirements=['wheel'])
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 295, in _get_build_requires
269.5 self.run_setup()
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 311, in run_setup
269.5 exec(code, locals())
269.5 File "<string>", line 224, in <module>
269.5 File "<string>", line 211, in setup_package
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
269.5 cythonize_one(*args)
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
269.5 raise CompileError(None, pyx_file)
269.5 Cython.Compiler.Errors.CompileError: spacy/kb.pyx
269.5 [end of output]
269.5
269.5 note: This error originates from a subprocess, and is likely not a problem with pip.
269.5 error: subprocess-exited-with-error
269.5
269.5 × Getting requirements to build wheel did not run successfully.
269.5 │ exit code: 1
269.5 ╰─> See above for output.
269.5
269.5 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:30
--------------------
28 | RUN printf "\nspacy!=3.0.6" >> requirements.txt
29 |
30 | >>> RUN pip install xtts-api-server -r requirements.txt
31 |
32 | # Expose the container ports
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install xtts-api-server -r requirements.txt" did not complete successfully: exit code: 1
Compiling spacy/pipeline/transition_parser.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/arc_eager.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/ner.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/nonproj.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/_state.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/stateclass.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/transition_system.pyx because it changed.
269.5 Compiling spacy/pipeline/_parser_internals/_beam_utils.pyx because it changed.
269.5 Compiling spacy/tokenizer.pyx because it changed.
269.5 Compiling spacy/training/align.pyx because it changed.
269.5 Compiling spacy/training/gold_io.pyx because it changed.
269.5 Compiling spacy/tokens/doc.pyx because it changed.
269.5 Compiling spacy/tokens/span.pyx because it changed.
269.5 Compiling spacy/tokens/token.pyx because it changed.
269.5 Compiling spacy/tokens/span_group.pyx because it changed.
269.5 Compiling spacy/tokens/graph.pyx because it changed.
269.5 Compiling spacy/tokens/morphanalysis.pyx because it changed.
269.5 Compiling spacy/tokens/_retokenize.pyx because it changed.
269.5 Compiling spacy/matcher/matcher.pyx because it changed.
269.5 Compiling spacy/matcher/phrasematcher.pyx because it changed.
269.5 Compiling spacy/matcher/dependencymatcher.pyx because it changed.
269.5 Compiling spacy/symbols.pyx because it changed.
269.5 Compiling spacy/vectors.pyx because it changed.
269.5 [ 1/41] Cythonizing spacy/attrs.pyx
269.5 [ 2/41] Cythonizing spacy/kb.pyx
269.5 Traceback (most recent call last):
269.5 File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
269.5 main()
269.5 File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
269.5 json_out['return_val'] = hook(**hook_input['kwargs'])
269.5 File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
269.5 return hook(config_settings)
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
269.5 return self._get_build_requires(config_settings, requirements=['wheel'])
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 295, in _get_build_requires
269.5 self.run_setup()
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 311, in run_setup
269.5 exec(code, locals())
269.5 File "<string>", line 224, in <module>
269.5 File "<string>", line 211, in setup_package
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
269.5 cythonize_one(*args)
269.5 File "/tmp/pip-build-env-5no_h93a/overlay/local/lib/python3.10/dist-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
269.5 raise CompileError(None, pyx_file)
269.5 Cython.Compiler.Errors.CompileError: spacy/kb.pyx
269.5 [end of output]
269.5
269.5 note: This error originates from a subprocess, and is likely not a problem with pip.
269.5 error: subprocess-exited-with-error
269.5
269.5 × Getting requirements to build wheel did not run successfully.
269.5 │ exit code: 1
269.5 ╰─> See above for output.
269.5
269.5 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:30
--------------------
28 | RUN printf "\nspacy!=3.0.6" >> requirements.txt
29 |
30 | >>> RUN pip install xtts-api-server -r requirements.txt
31 |
32 | # Expose the container ports
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install xtts-api-server -r requirements.txt" did not complete successfully: exit code: 1
but maybe I'm doing something else wrong
It worked for me using a local requirements.txt
Copy requirements.txt
from project root to docker
directory
Add spacy!=3.0.6
requirement (first line)
In Docker
file, replace
RUN pip install xtts-api-server`
with
ADD ./requirements.txt ./requirements.txt
RUN pip install xtts-api-server -r requirements.txt
Thanks @cif232 & @Firestorm7893 for the clues
I was able to get further by creating my own requirements file with the content:
spacy!=3.0.6
and then continue the installation with
pip install xtts-api-server -r req.txt
generally it tries to pull too many spacy versions probably best fixed with a more restrictive approach.
Afterwards it worked fine.
Well, this apparently worked. Thank you so much for posting this.
Using Python 3.11.7
Copy the attached requirements.txt to the main installation folder. 100% flawless install.
python -m venv venv
venv\Scripts\activate
pip install xtts-api-server -r requirements.txt
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
This guide is for CUDA 1.21 + Pytorch 2.3.0. Better than CUDA 1.18 + Pytorch 2.1.1 + deepspeed
It worked for me using a local
requirements.txt
- Copy
requirements.txt
from project root todocker
directory- Add
spacy!=3.0.6
requirement (first line)In
Docker
file, replaceRUN pip install xtts-api-server`
with
ADD ./requirements.txt ./requirements.txt RUN pip install xtts-api-server -r requirements.txt
Thanks @cif232 & @Firestorm7893 for the clues
@CosmicMac, I followed these instructions and did a docker compose build --no-cache
, but it still seems to download the spacy-3.0.6.tar.gz and errors out the same.
Any idea what I may be missing?
Hello, I've tried installing xtts-api-server in a virtual enviroment, but i keep getting this "Cython.Compiler.Errors.CompileError: spacy/kb.pyx" when it reaches "spacy-3.0.6.tar.gz". I've tried searching the internet and found one solution here https://github.com/explosion/spaCy/discussions/12941, but it didn't work. Here is the error code
Preparing metadata (pyproject.toml) ... done Using cached spacy-3.0.9-cp310-cp310-win_amd64.whl.metadata (17 kB) Using cached spacy-3.0.8-cp310-cp310-win_amd64.whl.metadata (17 kB) Using cached spacy-3.0.7.tar.gz (987 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Using cached spacy-3.0.6.tar.gz (7.1 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 ╰─> [164 lines of output]