Support for python 3.11

Abierto
#98 1 comentario 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
c, python
Área
backend

Línea de trabajo

Comienza reproduciendo el comando de instalación de pip para Python 3.11 e inspecciona setup.py, http_parser/http_parser.c y http_parser/parser.c alrededor de la compilación de la extensión. Confirma si el fallo se debe a una incompatibilidad del paquete o a la falta del encabezado de desarrollo Python.h y, después, verifica que la instalación se complete correctamente en Python 3.11.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hi,

Looks like the pip install for python 3.11 is failing with the below error

Is it because there is no support for python3.11?

Please help me overcome this issue.

Thanks in advance.

http-parser$ python3.11 -m pip install http-parser
Defaulting to user installation because normal site-packages is not writeable
Collecting http-parser
  Using cached http-parser-0.9.0.tar.gz (167 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: http-parser
  Building wheel for http-parser (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      /tmp/pip-install-87f67s16/http-parser_70fb4870541b4fc9ac3bfe953fb58d23/setup.py:12: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
        from imp import load_source
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.11
      creating build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/__init__.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/reader.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/util.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/_socketio.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/pyparser.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/http.py -> build/lib.linux-x86_64-3.11/http_parser
      running build_ext
      building 'http_parser.parser' extension
      creating build/temp.linux-x86_64-3.11
      creating build/temp.linux-x86_64-3.11/http_parser
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iparser -I/usr/include/python3.11 -c http_parser/http_parser.c -o build/temp.linux-x86_64-3.11/http_parser/http_parser.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iparser -I/usr/include/python3.11 -c http_parser/parser.c -o build/temp.linux-x86_64-3.11/http_parser/parser.o
      http_parser/parser.c:4:10: fatal error: Python.h: No such file or directory
          4 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-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 http-parser
  Running setup.py clean for http-parser
Failed to build http-parser
Installing collected packages: http-parser
  Running setup.py install for http-parser ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for http-parser did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      /tmp/pip-install-87f67s16/http-parser_70fb4870541b4fc9ac3bfe953fb58d23/setup.py:12: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
        from imp import load_source
      running install
      /usr/lib/python3/dist-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-3.11
      creating build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/__init__.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/reader.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/util.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/_socketio.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/pyparser.py -> build/lib.linux-x86_64-3.11/http_parser
      copying http_parser/http.py -> build/lib.linux-x86_64-3.11/http_parser
      running build_ext
      building 'http_parser.parser' extension
      creating build/temp.linux-x86_64-3.11
      creating build/temp.linux-x86_64-3.11/http_parser
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iparser -I/usr/include/python3.11 -c http_parser/http_parser.c -o build/temp.linux-x86_64-3.11/http_parser/http_parser.o
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iparser -I/usr/include/python3.11 -c http_parser/parser.c -o build/temp.linux-x86_64-3.11/http_parser/parser.o
      http_parser/parser.c:4:10: fatal error: Python.h: No such file or directory
          4 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-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.
╰─> http-parser

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Lenguaje dominante
C
Estrellas
345
Forks
93
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de benoitc/http-parser

Todos los issues de benoitc/http-parser

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.