在win8.1下使用命令python setup.py build构建python的扩展模块时,显示如下错误
E:\Tyler.demo\Language\Python\Cython>python setup.py build Compiling helloworld.pyx because it changed. [1/1] Cythonizing helloworld.pyx running build running build_ext building 'helloworld' extension error: Unable to find vcvarsall.bat
从网上查找相关解决方案,这篇文章“彻底解决安装Python扩展包时Unable to find vcvarsall.bat”比较全面的描述了原因及处理办法。本人按文章中方案二介绍的方法下载并安装了Microsoft Visual C++ Compiler for Python 2.7的补丁
本人使用的python:
E:\Tyler.demo\Language\Python\Cython>python Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
但是没有效果,按照方案一的介绍,修改了安装目录的相关文件:Lib\distutils\msvc9compiler.py
将243行注释,拷贝并修改为244行内容,直接指定本机上使用的VS2015~VC14。
再次build,成功
转载请注明原文地址: https://ju.6miu.com/read-33289.html