Mik*_*Lin 45 python distutils visual-studio-2010 easy-install
我已经安装了MSVC++ 2010 Express,而我的vcvarsall.bat文件C:\Program Files\Microsoft Visual Studio 10.0\VC
位于我的系统PATH中.当我运行时easy_install
,它找不到vcvarsall.bat.
我需要在distutils.cfg文件中设置一些东西来指向我的MSVC++安装吗?
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
Run Code Online (Sandbox Code Playgroud)
Pio*_*ost 57
我还是想知道在哪里设置对vsvarsall.bat的引用...
好吧,正如martineau所写,你必须安装Visual Studio 2008或Visual C++ Express.说完了,我知道你想知道Python在哪里查找这个批处理文件.您可以通过查看distutils/msvc9compiler.py标准模块中definition
的find_vcvarsall
函数来看到这一点.如果任何文件夹保存在注册表下的密钥下,Python会依次检查
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)或
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
文件的文件夹处理.
另请参阅我的其他答案,它解释了为什么您不能使用MSVC++ 2010来构建Python 2.6的扩展
编辑:VC++ 2008文件现在打包在MS的安装程序中,可以在此处下载.一旦安装vcvarsall.bat将在C:\Users\username\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0
归档时间: |
|
查看次数: |
75710 次 |
最近记录: |