Installation under Windows pycocotools

Installation under Windows pycocotools when the package, met a lot of pits, this article we want to make less go a little detour. pycocotools author never even consider windows version.

  • Installation pycocotools

COCO Address: https://github.com/cocodataset/cocoapi
Gangster rewritten support for Windows COCO Address: https://github.com/philferriere/cocoapi

Option One

CMD terminal installed using pip:

pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

Option II

https://github.com/philferriere/cocoapi download the source code, and unzip it. CMD as administrator open a terminal and switch to the cocoapi\PythonAPIdirectory. Run the following command:

# install pycocotools locally
python setup.py build_ext --inplace
 
# install pycocotools to the Python site-packages
python setup.py build_ext install

  • Attached: installation problems encountered

1, the mounting environmental problems

error: command 'cl.exe' failed: No such file or directory
// 或者
error: Unable to find vcvarsall.bat
// 或者
error: Microsoft Visual C++ 14.0 is required.
13068476-fd34bcc230e46425.png
error: command 'cl.exe' failed: No such file or directory
13068476-b9a1c847c72016de.png
pip install git+https://github.com/philferriere/cocoapi.git#subdir

Because there is no Visual C ++ compiler environment. Solution:
install Build Tools for Visual Studio 2017 (2015 version and later on the line, do not need to install the entire vs)


13068476-7b7cca0a76646238.png
vs2015

2, Wno-cpp and Wno-unused-function problems

cl: Command line error D8021: Invalid numerical parameters "/ Wno-cpp" and cl: Command line error D8021: Invalid numerical parameters "/ Wno-unused-function

Solution: Delete cocoapi\PythonAPI\setup.pyin the Wno-cpp and Wno-unused-function parameters.

13068476-6618ef3135277c23.png
Delete Wno-cpp parameters

Guess you like

Origin blog.csdn.net/weixin_34138521/article/details/90818353