我在执行make命令时出错error: Unable to find vcvarsall.bat
安装了vs2015之后就没有这个问题了,换了个bug…
makepython setup.py build_ext --inplacerunning build_extbuilding \'nms\' extensioncreating buildcreating build\\temp.win-amd64-3.6creating build\\temp.win-amd64-3.6\\ReleaseD:\\vs2015\\VC\\BIN\\x86_amd64\\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -ID:\\anaconda\\lib\\site-packages\\numpy\\core\\include -ID:\\anaconda\\include -ID:\\anaconda\\include -ID:\\vs2015\\VC\\INCLUDE -ID:\\vs2015\\VC\\ATLMFC\\INCLUDE \"-IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10150.0\\ucrt\" \"-IC:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6\\include\\um\" \"-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\" /Tcnms.c /Fobuild\\temp.win-amd64-3.6\\Release\\nms.obj -Wno-cpp -Wno-unused-functioncl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”error: command \'D:\\\\vs2015\\\\VC\\\\BIN\\\\x86_amd64\\\\cl.exe\' failed with exit status 2make: *** [Makefile:2: all] Error 1
解决方法,把出错的两个参数/Wno-cpp和-Wno-unused-function在setup.py里注释掉
import numpyfrom distutils.core import setupfrom distutils.extension import Extensionfrom Cython.Build import cythonizeextensions = [Extension(\"nms\",[\"nms.pyx\"],#extra_compile_args=[\"-Wno-cpp\", \"-Wno-unused-function\"])]setup(name=\"coco\",ext_modules=cythonize(extensions),include_dirs=[numpy.get_include()])
程序可以运行,好骚气的操作。。
参考博客