Solucionado (ver solução)
Solucionado
(ver solução)
9
respostas

erro docker-compose build pip install (requirements.txt)

ao rodar docker-compose build, gera o seguinte erro no terminal:

 => ERROR [5/5] RUN pip install -r requirements.txt                                                              108.8s

e logo após aparece isso:

#0 106.7   error: subprocess-exited-with-error
#0 106.7
#0 106.7   × Running setup.py install for ruamel.yaml.clib did not run successfully.
#0 106.7   │ exit code: 1
#0 106.7   ╰─> [27 lines of output]
#0 106.7       sys.argv ['/tmp/pip-install-3jagwuhm/ruamel-yaml-clib_7419aa0ba2754a98a887720edd9e9004/setup.py', 'install', '--record', '/tmp/pip-record-nc3pk30d/install-record.txt', '--single-version-externally-managed', '--compile', '--install-headers', '/usr/local/include/python3.11/ruamel.yaml.clib']
#0 106.7       test compiling /tmp/tmp_ruamel_7rz8ou4v/test_ruamel_yaml.c -> test_ruamel_yaml OK
#0 106.7       /usr/local/lib/python3.11/site-packages/setuptools/dist.py:286: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated, consider using implicit namespaces instead (PEP 420).
#0 106.7         warnings.warn(msg, SetuptoolsDeprecationWarning)
#0 106.7       running install
#0 106.7       /usr/local/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
#0 106.7         warnings.warn(
#0 106.7       running build
#0 106.7       running build_py
#0 106.7       creating build
#0 106.7       creating build/lib.linux-x86_64-cpython-311
#0 106.7       creating build/lib.linux-x86_64-cpython-311/ruamel
#0 106.7       copying .ruamel/__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel
#0 106.7       creating build/lib.linux-x86_64-cpython-311/ruamel/yaml
#0 106.7       copying .ruamel/yaml/__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel/yaml
#0 106.7       creating build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
#0 106.7       copying ./__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
#0 106.7       copying ./LICENSE -> build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
#0 106.7       running build_ext
#0 106.7       building '_ruamel_yaml' extension
#0 106.7       creating build/temp.linux-x86_64-cpython-311
#0 106.7       gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.11 -c _ruamel_yaml.c -o build/temp.linux-x86_64-cpython-311/_ruamel_yaml.o
#0 106.7       _ruamel_yaml.c:198:12: fatal error: longintrepr.h: No such file or directory
#0 106.7         198 |   #include "longintrepr.h"
#0 106.7             |            ^~~~~~~~~~~~~~~
#0 106.7       compilation terminated.
#0 106.7       error: command '/usr/bin/gcc' failed with exit code 1
#0 106.7       [end of output]
#0 106.7
#0 106.7   note: This error originates from a subprocess, and is likely not a problem with pip.
#0 106.7 error: legacy-install-failure
#0 106.7
#0 106.7 × Encountered error while trying to install package.
#0 106.7 ╰─> ruamel.yaml.clib
#0 106.7
#0 106.7 note: This is an issue with the package mentioned above, not pip.
#0 106.7 hint: See above for output from the failure.
------
failed to solve: executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1

como posso resolver?

9 respostas
solução!

Boa noite Thiago, não sou instrutor mas tive o mesmo erro que você e consegui resolvê-lo. O que tive que fazer é acessar o arquivos /restaurantes_api-master/setup/requirements.txt, na linha 24 e mudar de "ruamel.yaml.clib==0.2.6" para "ruamel.yaml.clib==0.2.7".

Basicamente, forcei instalar essa lib "ruamel.yaml.clib" na versão mais nova dela (que é a 0.2.7), aí deu certo. Vê se resolve ai para você.

Bom dia! Tive o mesmo problema e com essa dica do Henrique consegui resolver, obrigado por compartilhar!

Bom Dia TIve um problema similar e essa dica do Henrique foi certeira vlw

Dica perfeita. Tive o mesmo erro e resolveu, só o que mudou foi o caminho, o "requirements.txt" já estava dentro da pastas restaurantes_api-master. vlw!!!

Na mosca. Deu certo com a dica do Henrique. Vlw

Valeu

Felomenal o Henrique, foi certeiro na dica. Meus Parabéns amigo.

valeu aki tb foi.

Valeu pela dica HENRIQUE DE OLIVEIRA BUENO deucerto aqui tbm.