如何将easy_install指向vcvarsall.bat? [英] How do I point easy_install to vcvarsall.bat?

查看:75
本文介绍了如何将easy_install指向vcvarsall.bat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了MSVC ++ 2010 Express,并且我的vcvarsall.bat文件位于 C:\Program Files\Microsoft Visual Studio 10.0\VC ,这是在我的系统PATH中。当我运行 easy_install 时,找不到vcvarsall.bat。

I already have MSVC++ 2010 Express installed, and my vcvarsall.bat file is at C:\Program Files\Microsoft Visual Studio 10.0\VC, which is in my system PATH. When I run easy_install, it can't find vcvarsall.bat.

是否需要设置某些内容我的distutils.cfg文件指向我的MSVC ++安装了?

Is there something I need to set in my distutils.cfg file to point it to my MSVC++ installation?

G:\>easy_install hg-git
install_dir C:\Python26\Lib\site-packages\
Searching for hg-git
Best match: hg-git 0.2.6
Processing hg_git-0.2.6-py2.6.egg
hg-git 0.2.6 is already the active version in easy-install.pth

Using c:\python26\lib\site-packages\hg_git-0.2.6-py2.6.egg
Processing dependencies for hg-git
Searching for dulwich>=0.6.0
Reading http://pypi.python.org/simple/dulwich/
Reading http://samba.org/~jelmer/dulwich
Reading http://launchpad.net/dulwich
Best match: dulwich 0.7.1
Downloading http://www.samba.org/~jelmer/dulwich/dulwich-0.7.1.tar.gz
Processing dulwich-0.7.1.tar.gz
Running dulwich-0.7.1\setup.py -q bdist_egg --dist-dir c:\docume~1\mlin\locals~1
\temp\easy_install-fhraep\dulwich-0.7.1\egg-dist-tmp-qozily
error: Setup script exited with error: Unable to find vcvarsall.bat


推荐答案


I' d仍然想知道在哪里设置对vsvarsall.bat的引用。

I'd still like to know where to set that reference to vsvarsall.bat...

嗯,正如martineau所说,您必须安装了Visual Studio 2008或Visual C ++ Express。话虽如此,我了解您想知道Python在哪里查找此批处理文件。您可以通过查看 find_vcvarsall 函数的>定义 。 Python依次检查是否在注册表中的键下保存了任何文件夹

Well, as martineau wrote you have to have either Visual Studio 2008 or Visual C++ Express installed. Having said that I understand you would like to know where Python looks for this batch file. You can see this by looking at definition of find_vcvarsall function in distutils/msvc9compiler.py standard module. Python checks in turn if any of folders saved in the registry under keys


  • HKEY_LOCAL_MACHINE\Software\Wow6432Node\ \Microsoft\VisualStudio\9.0\Setup\VC\ProductDir

  • HKEY_LOCAL_MACHINE\软件\Wow6432Node\ Microsoft\VCExpress\9.0\Setup\VC\ProductDir

  • HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir
  • HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VCExpress\9.0\Setup\VC\ProductDir

(对于64位Windows )或

(for 64bit Windows) or


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

  • HKEY_LOCAL_MACHINE\软件\Microsoft\VCExpress\9.0\Setup\VC\ProductDir

  • HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir
  • HKEY_LOCAL_MACHINE\Software\Microsoft\VCExpress\9.0\Setup\VC\ProductDir

(对于32位Windows)存在,如果存在,它将这样的文件夹视为包含 vcvarsall.bat 文件。如果这些文件夹都不存在,Python将检查是否存在环境变量 VS90COMNTOOLS 。如果退出此变量,Python会将高于此变量值的两个级别的文件夹视为包含 vcvarsall.bat 文件的文件夹。

(for 32bit Windows) exists and if so it treats such folder as the one containing vcvarsall.bat file. If none of these folders exists Python checks if there's environment variable VS90COMNTOOLS. If this variable exits Python treats folder two levels above value of this variable as the folder containing vcvarsall.bat file.

另请参阅我的其他答案,该答案说明了为什么您不能使用MSVC ++ 2010构建Python 2.6扩展的原因

See also my other answer which explains why you can't use MSVC++ 2010 to build extensions for Python 2.6

编辑:
VC ++ 2008文件现在打包在MS的安装程序中,可以从此处。安装后,vcvarsall.bat将位于 C:\Users\username\AppData\Local\Programs\Common\Microsoft\Visual C ++ for Python\9.0

The VC++ 2008 files are now packaged in an installer from MS which can be downloaded here. Once installed vcvarsall.bat will be in C:\Users\username\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0

这篇关于如何将easy_install指向vcvarsall.bat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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