benoitc / benoitc/http-parser

Support for python 3.11

Aperta
#98 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
345
Fork
94
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the Python 3.11 pip install command and inspect setup.py, http_parser/http_parser.c, and http_parser/parser.c around the extension build. Confirm whether the failure is package compatibility or the missing Python.h development header, then verify that installation completes successfully on Python 3.11.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
c, python
Ambito
backend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.