Was getting the same thing. I somehow had Homebrew for x64 installed on my M3.
This this …
import platform
platform.machine()
If you get "x86", you need to brew uninstall
and install pkg file from https://github.com/Homebrew/brew/releases/tag/4.4.20