Windows下pip install pycocotools报错

在Windows下安装pycocotools,执行pip install pycocotools报错

pip install pycocotools

这是报错信息:

Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting pycocotools
  Using cached https://mirrors.aliyun.com/pypi/packages/de/df/056875d697c45182ed6d2ae21f62015896fdb841906fe48e7268e791c467/pycocotools-2.0.2.tar.gz (23 kB)
Requirement already satisfied: setuptools>=18.0 in d:\anaconda3\envs\test\lib\site-packages (from pycocotools) (52.0.0.post20210125)
Requirement already satisfied: cython>=0.27.3 in d:\anaconda3\envs\test\lib\site-packages (from pycocotools) (0.29.24)
Requirement already satisfied: matplotlib>=2.1.0 in d:\anaconda3\envs\test\lib\site-packages (from pycocotools) (3.3.4)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in d:\anaconda3\envs\test\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.4.7)
Requirement already satisfied: pillow>=6.2.0 in d:\anaconda3\envs\test\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (8.3.1)
Requirement already satisfied: cycler>=0.10 in d:\anaconda3\envs\test\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\anaconda3\envs\test\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (1.3.1)
Requirement already satisfied: numpy>=1.15 in d:\anaconda3\envs\test\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (1.19.5)
Requirement already satisfied: python-dateutil>=2.1 in d:\anaconda3\envs\test\lib\site-packages (from matplotlib>=2.1.0->pycocotools) (2.8.2)
Requirement already satisfied: six in d:\anaconda3\envs\test\lib\site-packages (from cycler>=0.10->matplotlib>=2.1.0->pycocotools) (1.15.0)
Building wheels for collected packages: pycocotools
  Building wheel for pycocotools (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Anaconda3\envs\test\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-f4erarxu\\pycocotools_6c866ebd872c45c98ae6a3f297991530\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-f4erarxu\\pycocotools_6c866ebd872c45c98ae6a3f297991530\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Admin\AppData\Local\Temp\pip-wheel-fnkglyms'
       cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-f4erarxu\pycocotools_6c866ebd872c45c98ae6a3f297991530\
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools
  copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools
  running build_ext
  cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
  D:\Anaconda3\envs\test\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\Admin\AppData\Local\Temp\pip-install-f4erarxu\pycocotools_6c866ebd872c45c98ae6a3f297991530\pycocotools\_mask.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  building 'pycocotools._mask' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools
  Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
    Running setup.py install for pycocotools ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda3\envs\test\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-f4erarxu\\pycocotools_6c866ebd872c45c98ae6a3f297991530\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-f4erarxu\\pycocotools_6c866ebd872c45c98ae6a3f297991530\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Admin\AppData\Local\Temp\pip-record-l28knydp\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Anaconda3\envs\test\Include\pycocotools'
         cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-f4erarxu\pycocotools_6c866ebd872c45c98ae6a3f297991530\
    Complete output (14 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\pycocotools
    copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools
    copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools
    copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools
    copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools
    running build_ext
    skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
    building 'pycocotools._mask' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Anaconda3\envs\test\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-f4erarxu\\pycocotools_6c866ebd872c45c98ae6a3f297991530\\setup.py'"'"'; __file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-f4erarxu\\pycocotools_6c866ebd872c45c98ae6a3f297991530\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Admin\AppData\Local\Temp\pip-record-l28knydp\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Anaconda3\envs\test\Include\pycocotools' Check the logs for full command output.

正确安装:

pip install pycocotools-windows

https://pypi.org/project/pycocotools-windows/

  • 9
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ayiya_Oese

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值