open-mmlab / cocoapi

COCO API - Dataset @ http://cocodataset.org/
Other
46 stars 34 forks source link

gcc: error: ../common/maskApi.c: No such file or directory #30

Open TerryBryant opened 1 year ago

TerryBryant commented 1 year ago

When running:pip install "git+https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"

I get "Running setup.py install for mmpycocotools did not run successfully. │ exit code: 1 ╰─> [10 lines of output] running install /opt/conda/envs/openmmlab/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py running build_ext building 'pycocotools._mask' extension gcc -pthread -B /opt/conda/envs/openmmlab/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/envs/openmmlab/lib/python3.8/site-packages/numpy/core/include -Icommon -I/opt/conda/envs/openmmlab/include/python3.8 -c ../common/maskApi.c -o build/temp.linux-x86_64-cpython-38/../common/maskApi.o gcc: error: ../common/maskApi.c: No such file or directory error: command '/usr/bin/gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> mmpycocotools "

Please help, thanks in advance.

Another-0 commented 1 year ago

It could be a version issue with the Cython library. Try using a lower version: pip install cython==0.29.36

hungtrieu07 commented 1 year ago

It could be a version issue with the Cython library. Try using a lower version: pip install cython==0.29.36

This solved my problem when install mmdetection 2.1.0

hubutui commented 8 months ago

If you would like to use cython >= 3, delete these two lines, https://github.com/open-mmlab/cocoapi/blob/01f805cd54d7bd7af64c0fbd5fd96d8ca0b9ddc9/pycocotools/pycocotools/_mask.pyx#L1-L2