- 安裝 Visual C++ 2015 Build Tools,
下載鏈接爲:Visual C++ 2015 Build Tools
](https://go.microsoft.com/fwlink/?LinkId=691126),下載後直接點擊默認安裝即可
2.進入文件夾 C:\Program Files (x86)\Microsoft Visual C++ Build Tools
打開文件夾並運行文件: vcbuildtools_msbuild.bat
3.在anaconda環境的命令行中,輸入
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI
錯誤解決辦法
ERROR: Command errored out with exit status 1:
command: 'D:\SoftWare\Anaconda\envs\yolo\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\SoftWare\\System\\TEMP\\Temp1\\pip-install-05yqhaov\\pycocotools\\P
ythonAPI\\setup.py'"'"'; __file__='"'"'D:\\SoftWare\\System\\TEMP\\Temp1\\pip-install-05yqhaov\\pycocotools\\PythonAPI\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);
code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'D:\SoftWare\System\TEMP\Temp1\pip-install-05yqhaov\pycoc
otools\PythonAPI\pip-egg-info'
cwd: D:\SoftWare\System\TEMP\Temp1\pip-install-05yqhaov\pycocotools\PythonAPI
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\SoftWare\System\TEMP\Temp1\pip-install-05yqhaov\pycocotools\PythonAPI\setup.py", line 2, in <module>
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
查看最後的報錯信息發現沒有安裝Cython安裝即可解決
conda install Cython