东方耀AI技术分享

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 3325|回复: 0
打印 上一主题 下一主题

[课堂笔记] windows上成功安装pycocotools(ImportError: No module named pycocotools)

[复制链接]

1365

主题

1856

帖子

1万

积分

管理员

Rank: 10Rank: 10Rank: 10

积分
14431
QQ
跳转到指定楼层
楼主
发表于 2019-12-24 19:42:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
windows上成功安装pycocotools




https://github.com/philferriere/cocoapi


ImportError: No module named pycocotools.coco
在linux上面比较简单:
pip install cython
pip install pycocotools




  1. (py3_torch_gpu) H:\tf_pytorch_works\Project12-Mask_RCNN\cocoapi-master\PythonAPI>python setup.py install
  2. Compiling pycocotools/_mask.pyx because it changed.
  3. [1/1] Cythonizing pycocotools/_mask.pyx
  4. D:\ProgramData\Miniconda3\envs\py3_torch_gpu\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: H:\tf_pytorch_works\Project12-Mask_RCNN\cocoapi-master\PythonAPI\pycocotools\_mask.pyx
  5.   tree = Parsing.p_module(s, pxd, full_module_name)
  6. running install
  7. running build
  8. running build_py
  9. creating build
  10. creating build\lib.win-amd64-3.6
  11. creating build\lib.win-amd64-3.6\pycocotools
  12. copying pycocotools\coco.py -> build\lib.win-amd64-3.6\pycocotools
  13. copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.6\pycocotools
  14. copying pycocotools\mask.py -> build\lib.win-amd64-3.6\pycocotools
  15. copying pycocotools\__init__.py -> build\lib.win-amd64-3.6\pycocotools
  16. running build_ext
  17. building 'pycocotools._mask' extension
  18. creating build\temp.win-amd64-3.6
  19. creating build\temp.win-amd64-3.6\Release
  20. creating build\temp.win-amd64-3.6\Release\pycocotools
  21. creating build\temp.win-amd64-3.6\common
  22. C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\ProgramData\Miniconda3\envs\py3_torch_gpu\lib\site-packages\numpy\core\include -I../common -ID:\ProgramData\Miniconda3\envs\py3_torch_gpu\include -ID:\ProgramData\Miniconda3\envs\py3_torch_gpu\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcpycocotools/_mask.c /Fobuild\temp.win-amd64-3.6\Release\pycocotools/_mask.obj
  23. _mask.c
  24. d:\programdata\miniconda3\envs\py3_torch_gpu\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
  25. pycocotools/_mask.c(3277): warning C4244: '=': conversion from 'Py_ssize_t' to 'siz', possible loss of data
  26. pycocotools/_mask.c(3681): warning C4244: 'function': conversion from 'npy_intp' to 'siz', possible loss of data
  27. pycocotools/_mask.c(6643): warning C4244: '=': conversion from 'npy_intp' to 'siz', possible loss of data
  28. pycocotools/_mask.c(7389): warning C4244: '=': conversion from 'Py_ssize_t' to 'siz', possible loss of data
  29. C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\ProgramData\Miniconda3\envs\py3_torch_gpu\lib\site-packages\numpy\core\include -I../common -ID:\ProgramData\Miniconda3\envs\py3_torch_gpu\include -ID:\ProgramData\Miniconda3\envs\py3_torch_gpu\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.6\Release\../common/maskApi.obj
  30. maskApi.c
  31. C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\ProgramData\Miniconda3\envs\py3_torch_gpu\libs /LIBPATH:D:\ProgramData\Miniconda3\envs\py3_torch_gpu\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" /EXPORT:PyInit__mask build\temp.win-amd64-3.6\Release\pycocotools/_mask.obj build\temp.win-amd64-3.6\Release\../common/maskApi.obj /OUT:build\lib.win-amd64-3.6\pycocotools\_mask.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\pycocotools\_mask.cp36-win_amd64.lib
  32. _mask.obj : warning LNK4197: export 'PyInit__mask' specified multiple times; using first specification
  33.    Creating library build\temp.win-amd64-3.6\Release\pycocotools\_mask.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\pycocotools\_mask.cp36-win_amd64.exp
  34. Generating code
  35. Finished generating code
  36. running install_lib
  37. creating D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools
  38. copying build\lib.win-amd64-3.6\pycocotools\coco.py -> D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools
  39. copying build\lib.win-amd64-3.6\pycocotools\cocoeval.py -> D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools
  40. copying build\lib.win-amd64-3.6\pycocotools\mask.py -> D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools
  41. copying build\lib.win-amd64-3.6\pycocotools\_mask.cp36-win_amd64.pyd -> D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools
  42. copying build\lib.win-amd64-3.6\pycocotools\__init__.py -> D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools
  43. byte-compiling D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools\coco.py to coco.cpython-36.pyc
  44. byte-compiling D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools\cocoeval.py to cocoeval.cpython-36.pyc
  45. byte-compiling D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools\mask.py to mask.cpython-36.pyc
  46. byte-compiling D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools\__init__.py to __init__.cpython-36.pyc
  47. running install_egg_info
  48. Writing D:\ProgramData\Miniconda3\envs\py3_torch_gpu\Lib\site-packages\pycocotools-2.0-py3.6.egg-info
复制代码


让天下人人学会人工智能!人工智能的前景一片大好!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|人工智能工程师的摇篮 ( 湘ICP备2020019608号-1 )

GMT+8, 2024-4-25 18:01 , Processed in 0.169194 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表