Install python aiortc module in msys2 mingw-64

1k Views Asked by At

I am trying to install aiortc module in msys2 enviroment.

(Trying to install with several methods (pip, python -m pip, git clone,...) attemps deleted due to 30000 characters limitation.)

The problem consists to lvpxmt library that it's not available to msys platfrom with pacman command.

Edit: I found a solution but there is no stable at all, so i want your help for a better solution:

  1. I modified https://github.com/aiortc/aiortc/blob/main/src/_cffi_src/build_vpx.py
'''
if sys.platform == "win32":
    libraries = ["vpxmt"]
else:
    libraries = ["vpx"]
'''
libraries = ["vpx"]
  1. I run pacman -S mingw-w64-x86_64-libvpx from msys terminal.

  2. Then git clone, python setup.py build and python setup.py install.

After this steps, i can import the aiortc module sucessfully.

The problem is when i run a application that i make, when a connection requested then here is the error.

$ python "Papinhio_player.py"
======== Running on http://192.168.1.20:8080 ========
(Press CTRL+C to quit)
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
INFO: Connection(0) Remote candidate "bad08d5c-a247-46af-9354-db284c66382a.local
" could not be resolved
INFO: Connection(0) Remote candidate "5e511bd8-9188-49ac-b81a-43948ff41e3e.local
" could not be resolved
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
INFO: Connection(0) Check CandidatePair(('192.168.1.20', 55814) -> ('94.67.45.23
8', 55812)) State.FROZEN -> State.WAITING
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('94.67.45.238
', 55812)) State.FROZEN -> State.WAITING
INFO: Connection(0) Check CandidatePair(('192.168.1.20', 55814) -> ('94.67.45.23
8', 55812)) State.WAITING -> State.IN_PROGRESS
INFO: Connection(0) Discovered peer reflexive candidate Candidate(gjhrDZjUZ2 1 u
dp 1845504255 2a02:587:4b01:cb00:55a5:20c2:3fa6:d4e8 55813 typ prflx)
INFO: Connection(0) Check CandidatePair(('2a02:587:4b01:cb00:55a5:20c2:3fa6:d4e8
', 55815) -> ('2a02:587:4b01:cb00:55a5:20c2:3fa6:d4e8', 55813)) State.WAITING ->
 State.IN_PROGRESS
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('94.67.45.238
', 55812)) State.WAITING -> State.IN_PROGRESS
INFO: Connection(0) Discovered peer reflexive candidate Candidate(MmDQaPhURm 1 u
dp 1845504255 2a02:587:4b01:cb00:21e9:4ebb:b1bc:d885 55813 typ prflx)
INFO: Connection(0) Check CandidatePair(('2a02:587:4b01:cb00:21e9:4ebb:b1bc:d885
', 55816) -> ('2a02:587:4b01:cb00:21e9:4ebb:b1bc:d885', 55813)) State.WAITING ->
 State.IN_PROGRESS
INFO: Connection(0) Discovered peer reflexive candidate Candidate(rLAuRJolEm 1 u
dp 1845504255 2a02:587:4b01:cb00:c5:9a05:88d5:5216 55813 typ prflx)
INFO: Connection(0) Check CandidatePair(('2a02:587:4b01:cb00:c5:9a05:88d5:5216',
 55818) -> ('2a02:587:4b01:cb00:c5:9a05:88d5:5216', 55813)) State.WAITING -> Sta
te.IN_PROGRESS
INFO: Connection(0) Discovered peer reflexive candidate Candidate(bk4YdRMUJm 1 u
dp 1845504255 2a02:587:4b01:cb00:35b5:b57c:da87:91d4 55813 typ prflx)
INFO: Connection(0) Check CandidatePair(('2a02:587:4b01:cb00:35b5:b57c:da87:91d4
', 55819) -> ('2a02:587:4b01:cb00:35b5:b57c:da87:91d4', 55813)) State.WAITING ->
 State.IN_PROGRESS
INFO: Connection(0) Discovered peer reflexive candidate Candidate(a8E4PNjgmF 1 u
dp 1845501695 192.168.1.20 55812 typ prflx)
INFO: Connection(0) Check CandidatePair(('192.168.1.20', 55814) -> ('192.168.1.2
0', 55812)) State.WAITING -> State.IN_PROGRESS
INFO: Connection(0) Check CandidatePair(('192.168.1.20', 55814) -> ('192.168.1.2
0', 55812)) State.IN_PROGRESS -> State.SUCCEEDED
INFO: Connection(0) ICE completed
ERROR: Exception in callback _ProactorDatagramTransport._loop_reading(<_Overlapp
edF...1.20', 5353))>)
handle: <Handle _ProactorDatagramTransport._loop_reading(<_OverlappedF...1.20',
5353))>)>
Traceback (most recent call last):
  File "C:/msys64/mingw64/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "C:/msys64/mingw64/lib/python3.8/asyncio/proactor_events.py", line 578, i
n _loop_reading
    self._protocol.datagram_received(data, addr)
  File "C:/msys64/mingw64/lib/python3.8/site-packages/aioice/mdns.py", line 55,
in datagram_received
    if isinstance(message, dns.message.QueryMessage):
AttributeError: module 'dns.message' has no attribute 'QueryMessage'
INFO: Connection(0) Discovered peer reflexive candidate Candidate(Zmrv1yIrFq 1 u
dp 1845501695 192.168.1.5 55812 typ prflx)
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('192.168.1.5'
, 55812)) State.WAITING -> State.FAILED
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('192.168.1.5'
, 55812)) State.FAILED -> State.IN_PROGRESS
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('192.168.1.5'
, 55812)) State.IN_PROGRESS -> State.IN_PROGRESS
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('192.168.1.5'
, 55812)) State.IN_PROGRESS -> State.SUCCEEDED
INFO: Connection(0) Check CandidatePair(('192.168.1.5', 55817) -> ('192.168.1.5'
, 55812)) State.SUCCEEDED -> State.SUCCEEDED
ERROR: Task was destroyed but it is pending!
task: <Task pending name='Task-44' coro=<RequestHandler.start() done, defined at
 C:/msys64/mingw64/lib/python3.8/site-packages/aiohttp-4.0.0a1-py3.8-mingw.egg/a
iohttp/web_protocol.py:437> wait_for=<Future pending cb=[<TaskWakeupMethWrapper
object at 0x000002907d437a00>()]>>

I don't believe this is application error, because the exact same application run with no errors in different enviroments (different from msys).

So, how can i resolve this errors? If needed i can provide the aiortc application code that i run.

1

There are 1 best solutions below

4
On

Looks like google broke something with the google-crc32c 1.1.3 update that happened today (Aug 30, 2021). I had a build that worked just a few days ago that started failing with this exact same error on github actions. I solved it by reverting back to 1.1.2, which works correctly.

I would recommend trying

pip install google-crc32c==1.1.2 aiortc

That should give you a working version of crc32.