aiortc / aioquic

QUIC and HTTP/3 implementation in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to run examples/http3_server.py with python3.10 or 3.11

Karthikdasari0423 opened this issue · comments

Hi @jlaine

while running examples/http3_server.py with python3.10 facing below error,

root@ubuntu:~/aioquic# python3 examples/http3_server.py --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem
Traceback (most recent call last):
File "/root/aioquic/examples/http3_server.py", line 561, in
module = importlib.import_module(module_str)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/root/aioquic/examples/demo.py", line 9, in
import httpbin
File "/usr/local/lib/python3.10/dist-packages/httpbin/init.py", line 3, in
from .core import *
File "/usr/local/lib/python3.10/dist-packages/httpbin/core.py", line 24, in
from raven.contrib.flask import Sentry
File "/usr/local/lib/python3.10/dist-packages/raven/init.py", line 49, in
from raven.base import * # NOQA
File "/usr/local/lib/python3.10/dist-packages/raven/base.py", line 37, in
from raven.conf.remote import RemoteConfig
File "/usr/local/lib/python3.10/dist-packages/raven/conf/remote.py", line 36, in
DEFAULT_TRANSPORT = discover_default_transport()
File "/usr/local/lib/python3.10/dist-packages/raven/conf/remote.py", line 18, in discover_default_transport
from raven.transport.threaded import ThreadedHTTPTransport
File "/usr/local/lib/python3.10/dist-packages/raven/transport/init.py", line 18, in
from raven.transport.registry import * # NOQA
File "/usr/local/lib/python3.10/dist-packages/raven/transport/registry.py", line 18, in
from raven.transport.twisted import TwistedHTTPTransport
File "/usr/local/lib/python3.10/dist-packages/raven/transport/twisted.py", line 16, in
from twisted.web.client import (
File "/usr/lib/python3/dist-packages/twisted/web/client.py", line 34, in
from twisted.web import error, http
File "/usr/lib/python3/dist-packages/twisted/web/http.py", line 185, in
from twisted.web._http2 import H2Connection
File "/usr/lib/python3/dist-packages/twisted/web/_http2.py", line 25, in
import h2.connection # type: ignore[import]
File "/usr/local/lib/python3.10/dist-packages/h2/connection.py", line 13, in
from hyperframe.frame import (
File "/usr/local/lib/python3.10/dist-packages/hyperframe/frame.py", line 17, in
from .flags import Flag, Flags
File "/usr/local/lib/python3.10/dist-packages/hyperframe/flags.py", line 14, in
class Flags(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'

I am unable to find workaround for this

Could someone please help

my python version is 3.10

Here is workaround,

Downgrade to python 3.9 worked fine

root@ubuntu:~# python3 -V
Python 3.10.6

cd /root/
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2
sudo update-alternatives --config python3

root@ubuntu:~/aioquic# python3 -V
Python 3.9.16

sudo apt-get install python3.9-distutils

pip3 install wsproto
pip3 install Jinja2==3.0.3
pip3 install werkzeug==2.0.
pip3 install asgiref
pip3 install starlette
pip3 install httpbin
pip3 install httpx
pip3 install aioquic
pip3 install 'flask<2.2.0'
pip3 install werkzeug==2.0.

cd /root/aioquic/
python3 examples/http3_server.py --certificate tests/ssl_cert.pem --private-key tests/ssl_key.pem -v

if any issues with pip or apt:-
cd /usr/lib/python3/dist-packages
sudo ln -s apt_inst.* apt_inst.so
sudo ln -s apt_pkg.* apt_pkg.so

This look it should be reported in a different project..