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\PythonAPI
directory. 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.
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)
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.py
in the Wno-cpp and Wno-unused-function parameters.