While using pip install on M1, this error happened:
>>> from xtcocotools.coco import COCO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/zhouchenye/miniconda3/envs/egypt-ocr/lib/python3.9/site-packages/xtcocotools/coco.py", line 58, in <module>
from . import mask as maskUtils
File "/Users/zhouchenye/miniconda3/envs/egypt-ocr/lib/python3.9/site-packages/xtcocotools/mask.py", line 3, in <module>
import xtcocotools._mask as _mask
ImportError: dlopen(/Users/zhouchenye/miniconda3/envs/egypt-ocr/lib/python3.9/site-packages/xtcocotools/_mask.cpython-39-darwin.so, 0x0002): tried: '/Users/zhouchenye/miniconda3/envs/egypt-ocr/lib/python3.9/site-packages/xtcocotools/_mask.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
(mmcv) zhouchenye@chenye-zhou xtcocoapi % pip3 list | grep xtcocotools
xtcocotools 1.13
(mmcv) zhouchenye@chenye-zhou xtcocoapi % python3 -c "from xtcocotools.coco import COCO"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/zhouchenye/Desktop/OPAY/eg-idcard-ocr/xtcocoapi/xtcocotools/coco.py", line 58, in <module>
from . import mask as maskUtils
File "/Users/zhouchenye/Desktop/OPAY/eg-idcard-ocr/xtcocoapi/xtcocotools/mask.py", line 3, in <module>
import xtcocotools._mask as _mask
ModuleNotFoundError: No module named 'xtcocotools._mask'
While using pip install on M1, this error happened:
After uninstall and install with source:
The results are as follow: