cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp“

背景

在windows上安装pycocotools时报错,报错log

D:\dev\MicrosoftVisualStudio2019\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD
-ID:\dev\Anaconda3\envs\torch\lib\site-packages\numpy\core\include 
-I../common -ID:\dev\Anaconda3\envs\torch\include 
-ID:\dev\Anaconda3\envs\torch\Include 
-ID:\dev\MicrosoftVisualStudio2019\VC\Tools\MSVC\14.29.30133\ATLMFC\include -ID:\dev\MicrosoftVisualStudio2019\VC\Tools\MSVC\14.29.30133\include "-ID:\Windows Kits\10\include\10.0.19041.0\ucrt" 
"-ID:\Windows Kits\10\include\10.0.19041.0\shared" 
"-ID:\Windows Kits\10\include\10.0.19041.0\um" 
"-ID:\Windows Kits\10\include\10.0.19041.0\winrt" 
"-ID:\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tc../common/maskApi.c /Fobuild\temp.win-amd64-cpython-37\Release../common/maskApi.obj -Wno-cpp -Wno-unused-function -std=c99
cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”
error: command 'D:\dev\MicrosoftVisualStudio2019\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2

解决方法

修改setup.py中extra_compile_args,修改后如下:

extra_compile_args=['-std=c99']

你可能感兴趣的:(#,环境安装,计算机视觉,人工智能,深度学习,图像处理)