Yuxiang1995 / ICDAR2021_MFD

1st Solution For ICDAR 2021 Competition on Mathematical Formula Detection(公式检测冠军方案)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed building wheel for mmpycocotools during requirements installation

pramaniksandip opened this issue · comments

Hi Team, As per github manual trying to install all the packages step by step. But following command troughing error. I am using DGX A100, python 3.8.12, pytorch==1.7.0+cu110 and mmcv-full==1.2.7

I am getting following error.
Running setup.py install for mmpycocotools ... error
error: subprocess-exited-with-error

Failed to build mmpycocotools
ERROR: Could not build wheels for mmpycocotools, which is required to install pyproject.toml-based projects

Complete error details mentioned below. Please guide.

(fcos4) root@pt-brhac-55cf55d5c8-rptrd:/workspace/nemo/ICDAR2021_MFD# pip install -r requirements.txt
Collecting cython
Using cached Cython-3.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB)
Requirement already satisfied: numpy in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from -r requirements/build.txt (line 3)) (1.21.5)
Collecting matplotlib
Using cached matplotlib-3.5.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (11.2 MB)
Collecting mmpycocotools
Using cached mmpycocotools-12.0.3.tar.gz (23 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: six in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 4)) (1.16.0)
Collecting terminaltables
Using cached terminaltables-3.1.10-py2.py3-none-any.whl (15 kB)
Collecting asynctest
Using cached asynctest-0.13.0-py3-none-any.whl (26 kB)
Collecting codecov
Using cached codecov-2.1.13-py2.py3-none-any.whl (16 kB)
Collecting flake8
Using cached flake8-5.0.4-py2.py3-none-any.whl (61 kB)
Collecting interrogate
Using cached interrogate-1.5.0-py3-none-any.whl (45 kB)
Collecting isort==4.3.21
Using cached isort-4.3.21-py2.py3-none-any.whl (42 kB)
Collecting kwarray
Using cached kwarray-0.6.14-py3-none-any.whl (106 kB)
Collecting pytest
Using cached pytest-7.4.2-py3-none-any.whl (324 kB)
Collecting ubelt
Using cached ubelt-1.3.3-py3-none-any.whl (217 kB)
Collecting xdoctest>=0.10.0
Using cached xdoctest-1.1.1-py3-none-any.whl (137 kB)
Requirement already satisfied: yapf in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from -r requirements/tests.txt (line 11)) (0.40.2)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.4.5-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.1 MB)
Collecting packaging>=20.0
Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting cycler>=0.10
Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0
Using cached fonttools-4.38.0-py3-none-any.whl (965 kB)
Collecting python-dateutil>=2.7
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting pyparsing>=2.2.1
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Requirement already satisfied: pillow>=6.2.0 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from matplotlib->-r requirements/runtime.txt (line 1)) (9.4.0)
Requirement already satisfied: setuptools>=18.0 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from mmpycocotools->-r requirements/runtime.txt (line 2)) (65.6.3)
Collecting coverage
Using cached coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225 kB)
Requirement already satisfied: requests>=2.7.9 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from codecov->-r requirements/tests.txt (line 2)) (2.28.1)
Collecting mccabe<0.8.0,>=0.7.0
Using cached mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB)
Collecting pycodestyle<2.10.0,>=2.9.0
Using cached pycodestyle-2.9.1-py2.py3-none-any.whl (41 kB)
Collecting importlib-metadata<4.3,>=1.1.0
Using cached importlib_metadata-4.2.0-py3-none-any.whl (16 kB)
Collecting pyflakes<2.6.0,>=2.5.0
Using cached pyflakes-2.5.0-py2.py3-none-any.whl (66 kB)
Collecting click>=7.1
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Collecting py
Using cached py-1.11.0-py2.py3-none-any.whl (98 kB)
Collecting tabulate
Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)
Collecting colorama
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting toml
Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting attrs
Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting pluggy<2.0,>=0.12
Using cached pluggy-1.2.0-py3-none-any.whl (17 kB)
Collecting iniconfig
Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting exceptiongroup>=1.0.0rc8
Using cached exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Requirement already satisfied: tomli>=1.0.0 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from pytest->-r requirements/tests.txt (line 8)) (2.0.1)
Collecting yapf
Using cached yapf-0.40.1-py3-none-any.whl (250 kB)
Using cached yapf-0.32.0-py2.py3-none-any.whl (190 kB)
Requirement already satisfied: typing-extensions>=3.6.4 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from importlib-metadata<4.3,>=1.1.0->flake8->-r requirements/tests.txt (line 3)) (4.7.1)
Requirement already satisfied: zipp>=0.5 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from importlib-metadata<4.3,>=1.1.0->flake8->-r requirements/tests.txt (line 3)) (3.15.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 2)) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 2)) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 2)) (1.26.14)
Requirement already satisfied: charset-normalizer<3,>=2 in /opt/conda/envs/fcos4/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 2)) (2.0.4)
Building wheels for collected packages: mmpycocotools
Building wheel for mmpycocotools (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [63 lines of output]

running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-37
creating build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/mask.py -> build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/coco.py -> build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/init.py -> build/lib.linux-x86_64-cpython-37/pycocotools
running build_ext
building 'pycocotools._mask' extension
creating build/temp.linux-x86_64-cpython-37
creating build/temp.linux-x86_64-cpython-37/common
creating build/temp.linux-x86_64-cpython-37/pycocotools
gcc -pthread -B /opt/conda/envs/fcos4/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/envs/fcos4/lib/python3.7/site-packages/numpy/core/include -Icommon -I/opt/conda/envs/fcos4/include/python3.7m -c common/maskApi.c -o build/temp.linux-x86_64-cpython-37/common/maskApi.o
common/maskApi.c: In function ‘rleDecode’:
common/maskApi.c:46:7: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for( k=0; k<R[i].cnts[j]; k++ ) (M++)=v; v=!v; }}
^~~
common/maskApi.c:46:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
for( k=0; k<R[i].cnts[j]; k++ ) (M++)=v; v=!v; }}
^
common/maskApi.c: In function ‘rleFrPoly’:
common/maskApi.c:166:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for(j=0; j<k; j++) x[j]=(int)(scale
xy[j
2+0]+.5); x[k]=x[0];
^~~
common/maskApi.c:166:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
for(j=0; j<k; j++) x[j]=(int)(scalexy[j2+0]+.5); x[k]=x[0];
^
common/maskApi.c:167:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for(j=0; j<k; j++) y[j]=(int)(scalexy[j2+1]+.5); y[k]=y[0];
^~~
common/maskApi.c:167:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
for(j=0; j<k; j++) y[j]=(int)(scalexy[j2+1]+.5); y[k]=y[0];
^
common/maskApi.c: In function ‘rleToString’:
common/maskApi.c:212:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if(more) c |= 0x20; c+=48; s[p++]=c;
^~
common/maskApi.c:212:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
if(more) c |= 0x20; c+=48; s[p++]=c;
^
common/maskApi.c: In function ‘rleFrString’:
common/maskApi.c:220:3: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
^~~~~
common/maskApi.c:220:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
while( s[m] ) m++; cnts=malloc(sizeof(uint)*m); m=0;
^~~~
common/maskApi.c:228:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
^~
common/maskApi.c:228:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
if(m>2) x+=(long) cnts[m-2]; cnts[m++]=(uint) x;
^~~~
common/maskApi.c: In function ‘rleToBbox’:
common/maskApi.c:141:31: warning: ‘xp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if(j%2==0) xp=x; else if(xp<x) { ys=0; ye=h-1; }
^
gcc -pthread -B /opt/conda/envs/fcos4/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/envs/fcos4/lib/python3.7/site-packages/numpy/core/include -Icommon -I/opt/conda/envs/fcos4/include/python3.7m -c pycocotools/_mask.c -o build/temp.linux-x86_64-cpython-37/pycocotools/_mask.o
gcc: error: pycocotools/_mask.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: Failed building wheel for mmpycocotools
Running setup.py clean for mmpycocotools
Failed to build mmpycocotools
Installing collected packages: yapf, xdoctest, ubelt, toml, terminaltables, tabulate, python-dateutil, pyparsing, pyflakes, pycodestyle, py, packaging, mccabe, kiwisolver, isort, iniconfig, importlib-metadata, fonttools, exceptiongroup, cython, cycler, coverage, colorama, asynctest, pluggy, matplotlib, kwarray, flake8, codecov, click, attrs, pytest, mmpycocotools, interrogate
Attempting uninstall: yapf
Found existing installation: yapf 0.40.2
Uninstalling yapf-0.40.2:
Successfully uninstalled yapf-0.40.2
Attempting uninstall: importlib-metadata
Found existing installation: importlib-metadata 6.7.0
Uninstalling importlib-metadata-6.7.0:
Successfully uninstalled importlib-metadata-6.7.0
Running setup.py install for mmpycocotools ... error
error: subprocess-exited-with-error

× Running setup.py install for mmpycocotools did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
running install
/opt/conda/envs/fcos4/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-37
creating build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/mask.py -> build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/coco.py -> build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-cpython-37/pycocotools
copying pycocotools/init.py -> build/lib.linux-x86_64-cpython-37/pycocotools
running build_ext
Compiling pycocotools/_mask.pyx because it changed.
[1/1] Cythonizing pycocotools/_mask.pyx
/opt/conda/envs/fcos4/lib/python3.7/site-packages/Cython/Compiler/Main.py:384: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-venjjh8v/mmpycocotools_1824eea94d794c2dbefee8f95888ad43/pycocotools/_mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools._mask' extension
creating build/common
creating build/temp.linux-x86_64-cpython-37
creating build/temp.linux-x86_64-cpython-37/common
creating build/temp.linux-x86_64-cpython-37/pycocotools
gcc -pthread -B /opt/conda/envs/fcos4/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/envs/fcos4/lib/python3.7/site-packages/numpy/core/include -Icommon -I/opt/conda/envs/fcos4/include/python3.7m -c ../common/maskApi.c -o build/temp.linux-x86_64-cpython-37/../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

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
(fcos4) root@pt-brhac-55cf55d5c8-rptrd:/workspace/ICDAR2021_MFD#

(fcos4) root@pt-brhac-55cf55d5c8-rptrd:/workspace/ICDAR2021_MFD# pip install -v -e .

Following Error:

cwd: /tmp/pip-install-mmzs0ypo/mmpycocotools_8b2791f3b92b4dbbb356955cca03a755/
Building wheel for mmpycocotools (setup.py) ... error
ERROR: Failed building wheel for mmpycocotools
Running setup.py clean for mmpycocotools
Running command python setup.py clean
running clean
removing 'build/temp.linux-x86_64-cpython-38' (and everything under it)
removing 'build/lib.linux-x86_64-cpython-38' (and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-3.8' does not exist -- can't clean it
Failed to build mmpycocotools
ERROR: Could not build wheels for mmpycocotools, which is required to install pyproject.toml-based projects
(fcos4) root@pt-brhac-55cf55d5c8-rptrd:/workspace/ICDAR2021_MFD#

Please guide

@pramaniksandip sorry for late reply, you can run pip install cython first, and then pip install mmpycocotools