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

Erro na instalação do Docker

Estou rodando o projeto no Wsl2.

Não consigo fazer o build do projeto da api. Ao rodar o comando docker-compose build o seguinte erro é retornado:

error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      sys.argv ['/tmp/pip-install-s55aynx6/ruamel-yaml-clib_902331c034e0483997c51a1c2aac1188/setup.py', 'bdist_wheel', '-d', '/tmp/pip-wheel-20lpktiu']
      test compiling /tmp/tmp_ruamel_8vy24bdj/test_ruamel_yaml.c -> test_ruamel_yaml OK
      /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).
        warnings.warn(msg, SetuptoolsDeprecationWarning)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/ruamel
      copying .ruamel/__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel
      creating build/lib.linux-x86_64-cpython-311/ruamel/yaml
      copying .ruamel/yaml/__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel/yaml
      creating build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
      copying ./__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
      copying ./LICENSE -> build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
      running build_ext
      building '_ruamel_yaml' extension
      creating build/temp.linux-x86_64-cpython-311
      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
      _ruamel_yaml.c:198:12: fatal error: longintrepr.h: No such file or directory
        198 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ruamel.yaml.clib
3 respostas

Salve, Henrique.

Experimenta instalar manualmente pra ver se passa a funcionar (estou assumindo que você já tem o python instalado, qualquer coisa me fala =D):

pip install cmake

O erro perciste mas parece que algo a mais deu errado. Estou com python instalado

   error: subprocess-exited-with-error

  × Running setup.py install for ruamel.yaml.clib did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      sys.argv ['/tmp/pip-install-ubylpcy5/ruamel-yaml-clib_11937ccc58d64595bbc1bf64c2723cd9/setup.py', 'install', '--record', '/tmp/pip-record-6wl2hvaz/install-record.txt', '--single-version-externally-managed', '--compile', '--install-headers', '/usr/local/include/python3.11/ruamel.yaml.clib']
      test compiling /tmp/tmp_ruamel_44r5h3do/test_ruamel_yaml.c -> test_ruamel_yaml OK
      /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).
        warnings.warn(msg, SetuptoolsDeprecationWarning)
      running install
      /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.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/ruamel
      copying .ruamel/__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel
      creating build/lib.linux-x86_64-cpython-311/ruamel/yaml
      copying .ruamel/yaml/__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel/yaml
      creating build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
      copying ./__init__.py -> build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
      copying ./LICENSE -> build/lib.linux-x86_64-cpython-311/ruamel/yaml/clib
      running build_ext
      building '_ruamel_yaml' extension
      creating build/temp.linux-x86_64-cpython-311
      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
      _ruamel_yaml.c:198:12: fatal error: longintrepr.h: No such file or directory
        198 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

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

× Encountered error while trying to install package.
╰─> ruamel.yaml.clib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
solução!

Consegui resolver, era versão errada do pacote ruamel.yaml.clib no arquivo requirements.txt Solução encontrada em: https://cursos.alura.com.br/forum/topico-erro-ao-executar-docker-compose-build-261496