jin-s13 / xtcocoapi

Extended COCO-API
Other
63 stars 24 forks source link

installation problem on m1 #29

Closed Kedao98 closed 1 year ago

Kedao98 commented 1 year ago

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)))

After uninstall and install with source:

git clone https://github.com/jin-s13/xtcocoapi.git
pip install -r requirements.txt 
python setup.py install

The results are as follow:

(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'
jin-s13 commented 1 year ago

Sorry, I have not tried the M1 device. Could you please try this https://github.com/cocodataset/cocoapi/issues/441#issuecomment-864391810?

jin-s13 commented 1 year ago

duplicated with #35