【转】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的 ...
随机推荐
- Jenkins安装卸载
下载安装去Jenkins官网下载Jenkins,Centos的话会下载到.rpm安装文件 安装.rpm文件使用命令rpm -ivh **.rpm 安装完成之后使用命令rpm -qc jenkins查看 ...
- C#缓存absoluteExpiration、slidingExpiration两个参数的疑惑
看了很多资料终于搞明白cache中absoluteExpiration,slidingExpiration这两个参数的含义. absoluteExpiration:用于设置绝对过期时间,它表示只要时间 ...
- Native App开发 与Web App开发(原生与web开发优缺点)
Native App开发 Native App开发即我们所称的传统APP开发模式(原生APP开发模式),该开发针对IOS.Android等不同的手机操作系统要采用不同的语言和框架进行开发,该模式通常是 ...
- DB2修改自增主键起始值
ALTER TABLE DB2INSTL.BT_AUDIT_COUNTY_DIFF_HISTORY_PX ALTER COLUMN ID RESTART WITH 18239
- HTML5+CSS3 效果网站集合
1.jquery插件库 HTML5制作3D樱花漫天飞舞 http://www.jq22.com/jquery-info3547 2.17素材网 http://www.17sucai.com/pi ...
- IOS-企业开发人员账号&邓白氏码申请记录
Apple开发人员账号分三种,个人.公司,还有企业.个人和公司都称为标准账号. 另一种是教育机构的账号. 账号介绍 个人和公司的就不说了.如今仅仅说企业账号 首先是申请企业账号的地址: https:/ ...
- Hadoop 2.2.0安装和配置lzo
转自:http://www.iteblog.com/archives/992 Hadoop经常用于处理大量的数据,如果期间的输出数据.中间数据能压缩存储,对系统的I/O性能会有提升.综合考虑压缩.解压 ...
- Flume的监控参数
参考 flume的http监控参数说明 普通的flume启动命令 bin/flume-ng agent -c conf -f conf/flume-conf.properties -n agent - ...
- PXE:偷梁换柱,成功 启动 centos live
default menu.c32 timeout 1 ### 偷梁换柱,成功 label centos76-live menu label centos76-live from ftp kernel ...
- git rebase 的使用
rebase 在 Git 中整合来自不同分支的修改主要有两种方法:merge 以及 rebase. 在本节中我们将学习什么是“rebase”,怎样使用“rebase”,并将展示该操作的惊艳之处,以及指 ...