Python Pip安装错误:找不到vcvarsall.bat.尝试了所有解决方案 [英] Python Pip install Error: Unable to find vcvarsall.bat. Tried all solutions

查看:126
本文介绍了Python Pip安装错误:找不到vcvarsall.bat.尝试了所有解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用

为32位的Python 2.7.8(anaconda 2.1.0)安装Scrapy.

pip install scrapy

我得到了这个错误

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

我已遵循在这些stackoverflow问题中找到的解决方案.没事.

适用于Python 2.7的Microsoft Visual C ++编译器

找不到vcvarsall.bat文件

错误:找不到vcvarsall.bat

获取错误:找不到vcvarsall.bat.当运行"pip install numpy"时在Windows7 64位上

pip安装会导致错误:无法找到vcvarsall.bat

如何将easy_install指向vcvarsall .bat?

pip install MySQL-python返回找不到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)进行了更新,该工具应自动检测用于python 2.7的Microsoft Visual C ++编译器.但是,我仍然遇到相同的错误.


我也尝试使用

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版本的代码.那是VS2008.我已经将系统变量VS90COMNTOOLS作为变量名添加到了变量中,并给出了VS120COMNTOOLS的值.

您可以在下面找到我的分步解决方案:

  1. 右键单击我的电脑".
  2. 点击属性
  3. 高级系统设置
  4. 环境变量
  5. 添加新的系统变量
  6. 在变量名称中输入VS90COMNTOOLS
  7. 将当前版本的值输入新变量.
  8. 关闭所有窗口

现在打开一个新会话,然后pip install your-package

I tried to install Scrapy for Python 2.7.8 (anaconda 2.1.0) 32-bit using

pip install scrapy

And I got this error

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

I have followed the solutions found in these stackover flow questions. Nothing worked.

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

This is the error, and a few lines above and below it:

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


I have both Microsoft Visual Studio 12.0, and Microsoft visual C++ compiler package for Python 2.7, both of which have the vcvarsall.bat file.


I have a system variable that is called 'VS120COMNTOOLS' and is its path is set to

C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\


I also added both paths to my environment variables. I've also tried just adding one, and then the other. My Path looks like this

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\;


I also updated by my setup tools (I think to version 8), which should autodetect Microsoft Visual C++ Compiler for Python 2.7. However, I'm still getting the same error.


I have also tried using

easy_install scrapy

And I get this error

error: Setup script exited with error: Microsoft Visual C++ 10.0 is required (Un

able to find vcvarsall.bat).


I also have the following in my registry

HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\12.0\Setup\VC\ProductDir

解决方案

I have tried all suggestions and found my own simple solution.

The problem is that codes written in external environment like C need compiler. Look for its own VS environment, i.e. VS 2008.

Currently my machine runs VS 2012 and faces Unable to find vcvarsall.bat. I studied codes that i want to install to find the VS version. It was VS 2008. i have add to system variable VS90COMNTOOLS as variable name and gave the value of VS120COMNTOOLS.

You can find my step by step solution below:

  1. Right click on My Computer.
  2. Click Properties
  3. Advanced system settings
  4. Environment variables
  5. Add New system variable
  6. Enter VS90COMNTOOLS to the variable name
  7. Enter the value of current version to the new variable.
  8. Close all windows

Now open a new session and pip install your-package

这篇关于Python Pip安装错误:找不到vcvarsall.bat.尝试了所有解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆