benoitc / benoitc/http-parser

Support for python 3.11

Ouverte
#98 1 commentaire 2 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C
Étoiles
345
Forks
94
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par reproduire la commande d’installation pip pour Python 3.11 et inspectez setup.py, http_parser/http_parser.c et http_parser/parser.c autour de la compilation de l’extension. Confirmez si l’échec est dû à une incompatibilité du paquet ou à l’absence de l’en-tête de développement Python.h, puis vérifiez que l’installation se termine correctement avec Python 3.11.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
c, python
Domaine
backend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.