解法，檢查有無 “-arm” 即可。
在 macOS x86 取得 platform.platform()
在 macOS arm:
Charles Duffy explained the problem in the comments, thank you! 😃
When I checked the platform in Python, it was indeed ARM:
> python -c 'import platform; print(platform.platform())'
So I had been using a Python installation for ARM.
Now I installed
brew and then
python3 from the Rosetta terminal and used the newly installed Python to initiate a fresh virtual environment, and this fixed it. (This article helped me a bit with it.)
When creating Python environments with
conda, it is possible to specify whether they should use Apple ARM or Intel-x64:
CONDA_SUBDIR=osx-arm64 conda create -n my_env pythonmakes an ARM environment
CONDA_SUBDIR=osx-64 conda create -n my_env pythonmakes an x64 environment