【转】Windows下Python快速解决error: Unable to find vcvarsall.bat
转自:http://blog.csdn.net/sad_sugar/article/details/73743863
系统配置:Windows10 x64, Visual Studio 2017, Python2.7.1
报错信息:error: Unable to find vcvarsall.bat
报错原因:在生成的时候,编译器从%PythonInstallPath%\distutils\msvc9compiler.py里的219行find_vcvarsall(version)函数中找不到vcvarsall.bat文件。
更具体的原因是,msvc9compiler.py从sys.version里提取MSVC的版本号,但是在注册表中并没有根据版本号找到vcvarsall.bat,在系统的环境变量中也没有找到版本号对应的路径。后来我根据版本号,在环境变量中添加了路径,但因为msvc9compiler.py主要是针对VS2008和VS2010所做的路径识别,因此还是不能正确地找到vcvarsall.bat。
解决方法:直接在find_vcvarsall(version)函数中返回vcvarsall.bat的绝对路径。
例如在我的计算机中,msvc9compiler.py的路径是D:\Program Files\Python27\Lib\distutils\msvc9compiler.py,其中find_vcvarsall在第219行,vcvarsall.ba的路径是C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"。在def find_vcvarsall(version):下面直接添上
vcvarsall = r"C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
return vcvarsall;
保存即可。
【转】Windows下Python快速解决error: Unable to find vcvarsall.bat的更多相关文章
- windows下Python扩展问题error: Unable to find vcvarsall.bat
由于对于Windows下Python扩展不熟,今天遇到一个安装问题,特此做个tag.解决方式在stackoverflow上,网址例如以下: http://stackoverflow.com/quest ...
- 解决error: Unable to find vcvarsall.bat【python 2.7/vs2010】
转自:http://blog.csdn.net/secretx/article/details/17472107 去下载安装VS2010(08版貌似也行,不过没必要用旧版,指不定哪个库又无法编译),给 ...
- windows上,python安装非官方包,提示error: Unable to find vcvarsall.bat
在windows机器上安装python非官方包,如果环境只是用于开发,不作任何测试的话,最好的解决办法是: 在Linux上pip安装好之后,把python根目录lib/python3.6/site-p ...
- 解决 Windows 编译 Fast R-CNN 的 bbox 和 nms 出现的错误 error: Unable to find vcvarsall.bat
在 Windows 下安装一个底层的 Python 包时(Fast R-CNN 的 bbox 和 nms),遇到 error: Unable to find vcvarsall.bat 错误,看到这个 ...
- 在windows下安装lxml 报错error: Unable to find vcvarsall.bat
刚开始安装 ,我是使用命令pip install lxml直接进行安装,不过出错了 error: Unable to find vcvarsall.bat 解决方案: 1.首先安装wheel,pip ...
- Python error: Unable to find vcvarsall.bat
在安装一些Python模块时,大部分是cpython写的模块时会发生如下错误 error: Unable to find vcvarsall.bat.先前的一篇文章:在Windows上安装Scrapy ...
- [转]Resolving Python error: Unable to find vcvarsall.bat
Resolving Python error: Unable to find vcvarsall.bat While installing python package flask-user usin ...
- error: Unable to find vcvarsall.bat
http://www.crifan.com/python_mmseg_error_unable_to_find_vcvarsall_bat/ [已解决]安装Python模块mmseg出错:error: ...
- error: Setup script exited with error: Unable to find vcvarsall.bat
安装mxnet python版本时遇到“Unable to find vcvarsall.bat”错误搜索一下后查到如下方法: python 3.5.2版本依赖高版本的vs解决办法是安装vs2015的 ...
随机推荐
- 为ExecutorService增加shutdown hook
public class ShutdownHook { private static final ShutdownHook INSTANCE = new ShutdownHook(); private ...
- Ubuntu18.04下可以完美运行Quake3 Arena
安装 其实很早就知道Linux下面可以跑Quake3, 但是一直没有付诸行动, 在硬盘上躺了很多年的Quake III Arena, 和Brood一起从来不舍得删, 昨天终于想起来试试. 安装很简单, ...
- Docker入门 - 005 Docker 容器连接
Docker 容器连接 前面我们实现了通过网络端口来访问运行在docker容器内的服务.下面我们来实现通过端口连接到一个docker容器 网络端口映射 我们创建了一个 python 应用的容器. do ...
- OpenLayers Node环境安装运行构建-支持Vue集成OpenLayers
NodeJS 环境安装包下载:https://nodejs.org/zh-cn/download/ 安装vue-cli3.0.1: https://cli.vuejs.org/guide/instal ...
- Linux nohup用法
在应用Unix/Linux时,我们一般想让某个程序在后台运行,于是我们将常会用 & 在程序结尾来让程序自动运行. 比如我们要运行mysql在后台: /usr/local/mysql/bin/m ...
- MVC5 IIS7 403错误
问题背景 MVC5部署到IIS7中显示403错误. 解决方案 <system.webServer> → <modules> 节点下的 ApplicationInsightsWe ...
- 修改Egret引擎代码的方法
某些情况下,我们需要修改Egret引擎的源码,我们可以在源码目录(一般如下:xxx\Egret\engine\x.x.x\src\egret)下直接修改ts代码. 在对应的项目下打开CMD命令行,输入 ...
- Linux Performance tool
https://www.tecmint.com/command-line-tools-to-monitor-linux-performance/ https://www.tecmint.com/lin ...
- 【转载】Hadoop官方文档翻译——HDFS Architecture 2.7.3
HDFS Architecture HDFS Architecture(HDFS 架构) Introduction(简介) Assumptions and Goals(假设和目标) Hardware ...
- Mac 开发必备 利器 iterm2 oh-my-zsh
推荐终端神器 iterm2 以及 oh-my-zsh,可以研究一下怎么用,好的开发环境是可以提高效率的,以及alias 的使用. https://www.zhihu.com/question/2744 ...