我尝试使用
为 Python 2.7.8 (anaconda 2.1.0) 32 位安装 Scrapypip install scrapy
我得到了这个错误
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).
我已遵循这些 stackover flow 问题中的解决方案。没有任何效果。
Microsoft Visual C++ Compiler for Python 2.7
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
这是错误,上下几行:
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 Studio 12.0 和适用于 Python 2.7 的 Microsoft Visual C++ 编译器包,它们都有 vcvarsall.bat 文件。
我有一个名为“VS120COMNTOOLS”的系统变量,它的路径设置为
C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\
我还将两个路径都添加到了我的环境变量中。我也试过只添加一个,然后添加另一个。我的路径是这样的
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 Python 2.7。但是,我仍然遇到同样的错误。
我也尝试过使用
easy_install scrapy
我得到了这个错误
error: Setup script exited with error: Microsoft Visual C++ 10.0 is required (Un
能够找到 vcvarsall.bat)。
我的注册表中还有以下内容
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir
最佳答案
我尝试了所有建议并找到了自己的简单解决方案。
问题是在C
等外部环境中编写的代码需要编译器。寻找自己的VS环境,即VS 2008。
目前我的机器运行 VS 2012 并面临 Unable to find vcvarsall.bat
。
我研究了要安装的代码以找到 VS 版本。它是 VS 2008。我已添加到系统变量 VS90COMNTOOLS
作为变量名,并给出了 VS120COMNTOOLS
的值。
您可以在下面找到我的分步解决方案:
- 右键单击我的电脑。
- pip 击属性
- 高级系统设置
- 环境变量
- 添加新系统变量
- 变量名输入VS90COMNTOOLS
- 将当前版本的值输入到新变量中。
- 关闭所有窗口
现在打开一个新 session 并pip install your-package
关于Python Pip 安装错误 : Unable to find vcvarsall. bat。尝试了所有解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27670365/