Streamlit_webrtc Memory error in M1 MacOSX

I got this error.

2022-07-22 10:10:41.039 Uncaught app exception
Traceback (most recent call last):
File “/Users/namirinz/opt/anaconda3/envs/face-app/lib/python3.10/site-packages/streamlit/scriptrunner/script_runner.py”, line 557, in _run_script
exec(code, module.dict)
File “app/pages/page2.py”, line 2, in
from streamlit_webrtc import webrtc_streamer
File “/Users/namirinz/opt/anaconda3/envs/face-app/lib/python3.10/site-packages/streamlit_webrtc/init.py”, line 10, in
from .component import (
File “/Users/namirinz/opt/anaconda3/envs/face-app/lib/python3.10/site-packages/streamlit_webrtc/component.py”, line 17, in
from aiortc.mediastreams import MediaStreamTrack
File “/Users/namirinz/opt/anaconda3/envs/face-app/lib/python3.10/site-packages/aiortc/init.py”, line 11, in
from .rtcdtlstransport import (
File “/Users/namirinz/opt/anaconda3/envs/face-app/lib/python3.10/site-packages/aiortc/rtcdtlstransport.py”, line 133, in
def verify_callback(x, y):
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see Using the ffi/lib objects — CFFI 1.15.1 documentation

The code I use is.

import streamlit as st
from streamlit_webrtc import webrtc_streamer

webrtc_streamer(key="Sample")

Environment

  • Python 3.10
  • MacOS 12.4
  • streamlit 1.11.0
  • streamlit-webrtc 0.42.0
  • aiortc 1.3.2
  • av 9.2.0