Fork me on Gitee

安装pycocotools错误

pycocotools


试了网上的很多办法没有安装成功,查询出错原因是缺乏gcc

直接: apt-get install gcc


错误如下:

   command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tbpgy7nf/pycocotools_08d9365d29414e86af1be58c356e8d8f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tbpgy7nf/pycocotools_08d9365d29414e86af1be58c356e8d8f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xn2v0t2n/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/pycocotools
          cwd: /tmp/pip-install-tbpgy7nf/pycocotools_08d9365d29414e86af1be58c356e8d8f/
     Complete output (19 lines):
     running install
     running build
     running build_py
     creating build
     creating build/lib.linux-x86_64-3.7
     creating build/lib.linux-x86_64-3.7/pycocotools
     copying pycocotools/__init__.py -> build/lib.linux-x86_64-3.7/pycocotools
     copying pycocotools/coco.py -> build/lib.linux-x86_64-3.7/pycocotools
     copying pycocotools/cocoeval.py -> build/lib.linux-x86_64-3.7/pycocotools
     copying pycocotools/mask.py -> build/lib.linux-x86_64-3.7/pycocotools
     running build_ext
     skipping 'pycocotools/_mask.c' Cython extension (up-to-date)
     building 'pycocotools._mask' extension
     creating build/temp.linux-x86_64-3.7
     creating build/temp.linux-x86_64-3.7/common
     creating build/temp.linux-x86_64-3.7/pycocotools
     gcc -pthread -B /usr/local/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/lib/python3.7/site-packages/numpy/core/include -I./common -I/usr/local/include/python3.7m -c ./common/maskApi.c -o build/temp.linux-x86_64-3.7/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
     unable to execute 'gcc': No such file or directory
     error: command 'gcc' failed with exit status 1
     ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tbpgy7nf/pycocotools_08d9365d29414e86af1be58c356e8d8f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tbpgy7nf/pycocotools_08d9365d29414e86af1be58c356e8d8f/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xn2v0t2n/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/pycocotools Check the logs for full command output.

posted @ 2021-09-26 14:33  ---dgw博客  阅读(952)  评论(0编辑  收藏  举报