mmcv
mmcv copied to clipboard
[Bug] mmcv won't be able to import on Python 3.11, macOS 13.2.1, arm64
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmcv).
Environment
Running python -c "from mmcv.utils import collect_env; print(collect_env())" gives me the same error.
Pytorch 2.0.1 installed by pip.
Reproduces the problem - code sample
from mmseg.apis import inference_model, init_model, show_result_pyplot
Reproduces the problem - command or script
from mmseg.apis import inference_model, init_model, show_result_pyplot
Running python -c "from mmcv.utils import collect_env; print(collect_env())" also gives me this error.
Reproduces the problem - error message
ImportError: dlopen([code dir]/.venv/lib/python3.11/site-packages/mmcv/_ext.cpython-311-darwin.so, 0x0002): tried: '[code dir]/.venv/lib/python3.11/site-packages/mmcv/_ext.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/[code dir]/.venv/lib/python3.11/site-packages/mmcv/_ext.cpython-311-darwin.so' (no such file), '[code dir]/.venv/lib/python3.11/site-packages/mmcv/_ext.cpython-311-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
Additional information
I think openmim generates _ext.cpython-311-darwin.so, but seems it's prebuilt with x86_64 arch.
same problem On ubuntu 20.04 python 3.8.10 torch 1.13.1,with high cpu usage,program blocking
import mmcv
mmcv==1.5.1 or mmcv=1.7.1
I see that mim packages (mmengine, etc) aren't build for apple silicon however the arm64 mim still installs them