Skip to content

Not installing on Python 3.13 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tishka17 opened this issue Aug 28, 2024 · 15 comments
Closed

Not installing on Python 3.13 #104

Tishka17 opened this issue Aug 28, 2024 · 15 comments

Comments

@Tishka17
Copy link

Python 3.13 is going to be released soon. We already have RC1 for a month.

I am using official docker image python:3.13.0rc1

# pip install httptools
Collecting httptools
  Downloading httptools-0.6.1.tar.gz (191 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 191.2/191.2 kB 2.8 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: httptools
  Building wheel for httptools (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [60 lines of output]
      /usr/local/lib/python3.13/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-313
      creating build/lib.linux-x86_64-cpython-313/httptools
      copying httptools/__init__.py -> build/lib.linux-x86_64-cpython-313/httptools
      copying httptools/_version.py -> build/lib.linux-x86_64-cpython-313/httptools
      creating build/lib.linux-x86_64-cpython-313/httptools/parser
      copying httptools/parser/errors.py -> build/lib.linux-x86_64-cpython-313/httptools/parser
      copying httptools/parser/__init__.py -> build/lib.linux-x86_64-cpython-313/httptools/parser
      running egg_info
      writing httptools.egg-info/PKG-INFO
      writing dependency_links to httptools.egg-info/dependency_links.txt
      writing requirements to httptools.egg-info/requires.txt
      writing top-level names to httptools.egg-info/top_level.txt
      reading manifest file 'httptools.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'httptools.egg-info/SOURCES.txt'
      running build_ext
      building 'httptools.parser.parser' extension
      creating build/temp.linux-x86_64-cpython-313
      creating build/temp.linux-x86_64-cpython-313/httptools
      creating build/temp.linux-x86_64-cpython-313/httptools/parser
      creating build/temp.linux-x86_64-cpython-313/vendor
      creating build/temp.linux-x86_64-cpython-313/vendor/llhttp
      creating build/temp.linux-x86_64-cpython-313/vendor/llhttp/src
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/tmp/pip-install-cekvexjd/httptools_8f43c903c14947d0a6671583a442f422/vendor/llhttp/include -I/tmp/pip-install-cekvexjd/httptools_8f43c903c14947d0a6671583a442f422/vendor/llhttp/src -I/usr/local/include/python3.13 -c httptools/parser/parser.c -o build/temp.linux-x86_64-cpython-313/httptools/parser/parser.o -O2
      httptools/parser/parser.c:849:1: warning: ‘Py_UNICODE’ is deprecated [-Wdeprecated-declarations]
        849 | static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
            | ^~~~~~
      httptools/parser/parser.c: In function ‘__Pyx_Py_UNICODE_strlen’:
      httptools/parser/parser.c:850:5: warning: ‘Py_UNICODE’ is deprecated [-Wdeprecated-declarations]
        850 |     const Py_UNICODE *u_end = u;
            |     ^~~~~
      httptools/parser/parser.c: In function ‘__pyx_pf_9httptools_6parser_6parser_10HttpParser_10feed_data’:
      httptools/parser/parser.c:3531:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
       3531 |       __pyx_v_err_pos = llhttp_get_error_pos(__pyx_v_self->_cparser);
            |                       ^
      httptools/parser/parser.c: In function ‘__Pyx_PyInt_As_long’:
      httptools/parser/parser.c:9938:27: error: too few arguments to function ‘_PyLong_AsByteArray’
       9938 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      In file included from /usr/local/include/python3.13/longobject.h:107,
                       from /usr/local/include/python3.13/Python.h:77,
                       from httptools/parser/parser.c:22:
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      httptools/parser/parser.c: In function ‘__Pyx_PyInt_As_int’:
      httptools/parser/parser.c:10134:27: error: too few arguments to function ‘_PyLong_AsByteArray’
      10134 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      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 httptools
  Running setup.py clean for httptools
Failed to build httptools
@robd003
Copy link

robd003 commented Sep 29, 2024

Seems like this pull request would fix it: #101

@robd003
Copy link

robd003 commented Sep 29, 2024

@1st1 @elprans @fantix Could you guys chime in here?

Would love to get httptools working before Python 3.13 is out so that https://github.com/sanic-org/sanic will be compatible with 3.13

@Tishka17
Copy link
Author

Tishka17 commented Oct 7, 2024

Python 3.13 is released

frankie567 added a commit to frankie567/httpx-ws that referenced this issue Oct 9, 2024
This reverts commit 3dc4a85.

`httptools` fails to install on 3.13. See: MagicStack/httptools#104
@Odud
Copy link

Odud commented Oct 9, 2024

I'm keen for a fix for this as it is currently preventing me from installing fastapi[all] with 3.13

@andrlik
Copy link

andrlik commented Oct 9, 2024

Same for me as uvicorn[standard] depends on this.

@ibraheemalayan
Copy link

any updates on this issues ?

@nastiliano
Copy link

The same problem for me in Python 3.13.

Thanks.

@Bkmd100
Copy link

Bkmd100 commented Oct 11, 2024

Seems like this pull request would fix it: #101

cloning his fork and installing it worked for me.

@fantix
Copy link
Member

fantix commented Oct 14, 2024

Fixed in 0.6.2

@fantix fantix closed this as completed Oct 14, 2024
@robd003
Copy link

robd003 commented Oct 14, 2024

You rock @fantix !

@nastiliano
Copy link

@fantix Great!!
Thanks!

@hipertracker
Copy link

Still not working on python 3.13.0

root@6eb14f41c1bb:/app# uv add uvicorn[standard]
Resolved 193 packages in 1.63s
Prepared 4 packages in 312ms
Installed 4 packages in 2ms
 + httptools==0.6.4
 + uvloop==0.21.0
 + watchfiles==0.24.0
 + websockets==13.1

root@6eb14f41c1bb:/app# gunicorn biblia.asgi:application --bind 0.0.0.0:8000 --workers 4 -k uvicorn.workers.UvicornWork
[2024-10-22 01:47:46 +0000] [75] [INFO] Starting gunicorn 23.0.0
[2024-10-22 01:47:46 +0000] [75] [INFO] Listening at: http://0.0.0.0:8000 (75)
[2024-10-22 01:47:46 +0000] [75] [INFO] Using worker: uvicorn.workers.UvicornWork
[2024-10-22 01:47:46 +0000] [75] [ERROR] Unhandled exception in main loop
Traceback (most recent call last):
  File "/app/.venv/lib/python3.13/site-packages/gunicorn/arbiter.py", line 201, in run
    self.manage_workers()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/app/.venv/lib/python3.13/site-packages/gunicorn/arbiter.py", line 570, in manage_workers
    self.spawn_workers()
    ~~~~~~~~~~~~~~~~~~^^
  File "/app/.venv/lib/python3.13/site-packages/gunicorn/arbiter.py", line 641, in spawn_workers
    self.spawn_worker()
    ~~~~~~~~~~~~~~~~~^^
  File "/app/.venv/lib/python3.13/site-packages/gunicorn/arbiter.py", line 588, in spawn_worker
    worker = self.worker_class(self.worker_age, self.pid, self.LISTENERS,
                               self.app, self.timeout / 2.0,
                               self.cfg, self.log)
TypeError: 'str' object is not callable

But with h11 all is fine

root@6eb14f41c1bb:/app# gunicorn biblia.asgi:application --bind 0.0.0.0:8000 --workers 4 -k uvicorn.workers.UvicornH11Worker
[2024-10-22 01:50:28 +0000] [76] [INFO] Starting gunicorn 23.0.0
[2024-10-22 01:50:28 +0000] [76] [INFO] Listening at: http://0.0.0.0:8000 (76)
[2024-10-22 01:50:28 +0000] [76] [INFO] Using worker: uvicorn.workers.UvicornH11Worker
[2024-10-22 01:50:28 +0000] [77] [INFO] Booting worker with pid: 77
[2024-10-22 01:50:28 +0000] [78] [INFO] Booting worker with pid: 78
[2024-10-22 01:50:28 +0000] [79] [INFO] Booting worker with pid: 79
[2024-10-22 01:50:28 +0000] [80] [INFO] Booting worker with pid: 80
[2024-10-22 01:50:29 +0000] [77] [INFO] Started server process [77]
[2024-10-22 01:50:29 +0000] [77] [INFO] Waiting for application startup.
[2024-10-22 01:50:29 +0000] [77] [INFO] ASGI 'lifespan' protocol appears unsupported.
[2024-10-22 01:50:29 +0000] [77] [INFO] Application startup complete.
[2024-10-22 01:50:29 +0000] [78] [INFO] Started server process [78]
[2024-10-22 01:50:29 +0000] [78] [INFO] Waiting for application startup.
[2024-10-22 01:50:29 +0000] [78] [INFO] ASGI 'lifespan' protocol appears unsupported.
[2024-10-22 01:50:29 +0000] [78] [INFO] Application startup complete.
[2024-10-22 01:50:29 +0000] [79] [INFO] Started server process [79]
[2024-10-22 01:50:29 +0000] [79] [INFO] Waiting for application startup.
[2024-10-22 01:50:29 +0000] [79] [INFO] ASGI 'lifespan' protocol appears unsupported.
[2024-10-22 01:50:29 +0000] [79] [INFO] Application startup complete.
[2024-10-22 01:50:29 +0000] [80] [INFO] Started server process [80]
[2024-10-22 01:50:29 +0000] [80] [INFO] Waiting for application startup.

@gnusupport
Copy link

I am on Debian Python 3.11 and cannot install httptools

      creating build/temp.linux-x86_64-cpython-311/vendor/llhttp/src
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -I/usr/include/python3.11 -fPIC -I/home/data1/protected/tmp/pip-install-rgwogxkm/httptools_56bae22d6e9647449980faa34050bca5/vendor/llhttp/include -I/home/data1/protected/tmp/pip-install-rgwogxkm/httptools_56bae22d6e9647449980faa34050bca5/vendor/llhttp/src -I/home/data1/protected/TTS/include -I/usr/include/python3.11 -c httptools/parser/parser.c -o build/temp.linux-x86_64-cpython-311/httptools/parser/parser.o -O2
      httptools/parser/parser.c:214:12: fatal error: longintrepr.h: No such file or directory
        214 |   #include "longintrepr.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 httptools

@elprans
Copy link
Member

elprans commented Jan 11, 2025

Make sure you're using the latest version (0.6.4).

@gnusupport
Copy link

I got it working with new fresh venv. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests