首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Python Pip安装错误:找不到vcvarsall.bat。尝试了所有解决方案

Python Pip安装错误:找不到vcvarsall.bat。尝试了所有解决方案
EN

Stack Overflow用户
提问于 2014-12-28 02:43:53
回答 2查看 185.4K关注 0票数 54

我尝试使用以下命令安装Scrapy for Python 2.7.8 (anaconda 2.1.0) 32位

代码语言:javascript
复制
pip install scrapy

我得到了这个错误

代码语言:javascript
复制
 error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).

我遵循了在这些堆叠流问题中找到的解决方案。什么都不管用。

Microsoft Visual C++ Compiler for Python 2.7

Can't find vcvarsall.bat file

error: Unable to find vcvarsall.bat

Getting "error: Unable to find vcvarsall.bat" when running "pip install numpy" on windows7 64bit

pip install gives error: Unable to find vcvarsall.bat

How do I point easy_install to vcvarsall.bat?

pip install MySQL-python returns unable to find vcvarsall.bat

这是错误,以及它上面和下面的几行:

代码语言:javascript
复制
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt
-> build\lib.win32-3.4\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown distribution opt
ion: 'bugtrack_url'

  warnings.warn(msg)

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).


----------------------------------------
Command "C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:
\\Users\\San\\AppData\\Local\\Temp\\pip-build-wp6ei6r9\\lxml\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record C:\Users\San\AppData\Local\Temp\pip-kfkzr_67-r
ecord\install-record.txt --single-version-externally-managed --compile" failed w
ith error code 1 in C:\Users\San\AppData\Local\Temp\pip-build-wp6ei6r9\lxml

我有Microsoft Visual Studio12.0和用于Python2.7的Microsoft visual C++编译器包,它们都有vcvarsall.bat文件。

我有一个名为'VS120COMNTOOLS‘的系统变量,它的路径设置为

代码语言:javascript
复制
C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\

我还将两个路径都添加到了我的环境变量中。我也试着只添加一个,然后再添加另一个。我的路径看起来像这样

代码语言:javascript
复制
C:\Program Files\Java\jdk1.7.0_25\bin;\Python27;\Python2\python.exe;C:\Python27\Scripts\;C:\Users\San\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\;C:\Program Files\Microsoft Visual Studio 12.0\VC\;

我还更新了我的安装工具(我想升级到版本8),它应该会自动检测Microsoft Visual C++ Compiler for Python2.7。但是,我仍然收到相同的错误。

我也尝试过使用

代码语言:javascript
复制
easy_install scrapy

我得到了这个错误

代码语言:javascript
复制
error: Setup script exited with error: Microsoft Visual C++ 10.0 is required (Un

能够找到vcvarsall.bat)。

我的注册表中也有以下内容

代码语言:javascript
复制
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir
EN

回答 2

Stack Overflow用户

发布于 2014-12-28 07:42:54

尝试安装this,这是为Python2.7启用C++编译器的已知变通方法。

根据我的经验,当pip找不到vcvarsall.bat编译器时,我所做的就是打开一个Visual Studio控制台,因为它将path变量设置为直接调用vcvarsall.bat,然后在此命令行上运行pip。

票数 30
EN

Stack Overflow用户

发布于 2015-03-07 11:05:29

我在python 3.4.3中也遇到了同样的错误,我尝试使用这里和其他地方提到的解决方案,但都没有成功。

微软为Python2.7提供了一个编译器,但自从我使用3.4.3版本以来,它并没有给我带来多大的好处。

Python3.3版本已过渡到2010版本,您可以在此处免费下载并安装Visual C++ 2010学习版:https://www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express

以下是关于3.3过渡到2010的官方博客文章:http://blog.python.org/2012/05/recent-windows-changes-in-python-33.html

因为以前的版本给出了一个不同的vcvarsall.bat错误,所以我会仔细检查您使用"pip -V“的版本。

代码语言:javascript
复制
C:\Users\B>pip -V
pip 6.0.8 from C:\Python34\lib\site-packages (python 3.4)

顺便说一句,我也尝试过先使用最新版本的VC++ (2013),但它需要安装2010 express。

从那时起,它应该适用于任何使用32位版本的人,如果你使用的是64位版本,那么你将得到ValueError:'path‘消息,因为VC++ 2010没有64位强制。要做到这一点,你必须获得Microsoft SDK 7.1。我不能超链接64位的指令,因为我被限制在每个帖子2个链接,但它在

Python PIP has issues with path for MS Visual Studio 2010 Express for 64-bit install on Windows 7

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27670365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档