安装到vcvarsall.bat?

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

有什么我需要在我的distutils.cfg文件中设置指向我的MSVC ++安装?

G:>easy_install hg-git
install_dir C:Python26Libsite-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:python26libsite-packageshg_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.1setup.py -q bdist_egg --dist-dir c:docume~1mlinlocals~1
tempeasy_install-fhraepdulwich-0.7.1egg-dist-tmp-qozily
error: Setup script exited with error: Unable to find vcvarsall.bat

我仍然想知道在哪里设置对vsvarsall.bat的引用...

那么,正如martineau写的,你必须安装Visual Studio 2008或Visual C ++ Express。 话虽如此,我明白你想知道Python在这个批处理文件中的位置。 您可以通过查看distutils / msvc9compiler.py标准模块中find_vcvarsall函数的definition来看到这一点。 Python依次检查是否有任何文件夹保存在注册表中的密钥下

  • HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftVisualStudio9.0SetupVCProductDir
  • HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftVCExpress9.0SetupVCProductDir
  • (用于64位Windows)或者

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

    另请参阅我的其他答案,它解释了为什么您不能使用MSVC ++ 2010为Python 2.6构建扩展

    编辑:VC ++ 2008文件现在打包在MS的安装程序,可以在这里下载。 一旦安装vcvarsall.bat将位于C:UsersusernameAppDataLocalProgramsCommonMicrosoftVisual C++ for Python9.0

    链接地址: http://www.djcxy.com/p/26293.html

    上一篇: install to vcvarsall.bat?

    下一篇: Building lxml for Python 2.7 on Windows