Python的PIP与路径MS Visual Studio 2010的前preSS的64位问题上安装的Windows 7路径、问题、MS、Visual

2023-09-08 09:58:48 作者:先森°下个路口见

我创建了一个干净安装的virtualenv的python 3.3,64位版本。 (注:我有蟒蛇的几个的安装在我的电脑,包括WinPython上,但要建立干净的小virtualenvs为我工作的几个项目WinPython版本的作品就好了。)当我使用PIP尝试安装软件包,我得到一个错误信息(如果需要可以包括画中画日志)。最终,该错误消息的最后系是:

I was creating a virtualenv with a clean install of python 3.3, 64-bit version. (Note: I have several installs of python on my computer including WinPython but want to set up clean and small virtualenvs for several projects that I am working on. The WinPython version works just fine.) When I used pip to try to install packages, I got an error message (can include pip log if requested). Ultimately, the last lines of the error message were:

File "c:\python33-b\Lib\distutils\msvc9compiler.py", line 287, in query_vcvarsall raise ValueError(str(list(result.keys())))

ValueError: ['path']

我从msvc9compiler.py函数query_vcvarsall调查的结果。我发现,这个功能一直在寻找vcvarsall从微软的Visual Studio中10例preSS在我的电脑上的路径。它正在寻找4个组成部分:包含=,PATH =,= LIB和LIBPATH =。这些都是具体的MS VS 2010年我的安装派AMD64的参数给这个函数。它没有发现任何东西,但PATH =语句,但它确实找到vcvarsall.bat文件。当我欺骗这个功能使用86的说法,就发现所有的4语句,似乎,好像它会运行正常。

I investigated the results from the function query_vcvarsall in the msvc9compiler.py. I found out that this function was looking for the path of vcvarsall from MS Visual Studio 10 Express on my computer. It is looking for 4 components: INCLUDE=, PATH=, LIB=, and LIBPATH=. These were specific for MS VS 2010. My install sent an argument of "amd64" to this function. It did not find anything but the PATH= statement but it did find the vcvarsall.bat file. When I tricked this function to use the "x86" argument, it found all of the 4 statements and appeared as if it would run fine.

我花了一些时间在网络上研究这个。我发现,MS VS防爆preSS 2010默认为32位安装。一个人必须将其设置为64位运行(这意味着它上面设置所需要的报表。)显然出现了一个错误和64位工具都无法与此版本的安装。所以,我为了安装64位工具安装MS SDK。后来我发现有一个修复到这一点,并安装(在链接如下所示)。

I spent some time researching this on the web. I found that MS VS Express 2010 installs by default as 32-bit. One has to set it to run as 64-bit (which means it will set the statements needed above.) Apparently there was a bug and the 64-bit tools were not installed with this version. So I installed MS SDK in order to install the 64-bit tools. I then found there was a fix to this and installed that (listed below in links).

有概述创造了64位与路径的几种方法一个是执行 vcvarsall AMD64 为MS VS.在命令行上这就产生了一个消息,说的工具是不是在我的电脑上安装。这些工具都是驻留在 C:\ Program Files文件(x86)的\微软的Visual Studio 10.0 \ VC \ BIN \ AMD64 目录。这显然​​是要找的文件是vcvars64.bat(或类似的东西)。我有目录,但不是批处理文件。 (有使用x86_amd64方法的建议,但它拥有所有相同的问题。)

There were several methods outlined to create the paths for the 64-bit VS. One was to run vcvarsall amd64 on the command line for MS VS. This resulted in a message saying the tools were not installed on my computer. These tools were to reside in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64 directory. The file that it apparently is looking for is vcvars64.bat (or something similar). I have the directory but not the batch file. (There was a recommendation to use the x86_amd64 method but it has all of the same issues.)

第二项建议是从SDK命令行中运行 SETENV / 64 。我跑了,它似乎正确运行。然而,当我去我试图通过PIP安装包,我得到了同样的错误消息。

The second recommendation was to run setenv /x64 from the SDK command line. I ran that and it seemed to run correctly. However, when I went I tried to install packages via pip, I got the same error message.

我的问题最终是如何获得PIP流畅运行?刚提的,是的,我没有重新启动之前,我测试的点子后,再次每次安装并尝试解决这个。

My question ultimately is how to get pip running smoothly? Just to mention, yes, I did reboot before I tested pip again after each install and attempt at fixing this.

下面是一些网站,帮助我走到这一步:

Here are some sites that helped me get this far:

1)Launching从Visual Studio 2010 64位命令提示符

1) Launching a 64-bit command prompt from Visual Studio 2010

2)设置路径和环境变量的MS Visual Studio 2010的命令行构建: http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx

2) Setting the Path and Environment Variables for MS VS 2010 Command-Line Builds: http://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx

3)VS2010防爆preSS和失踪的x64编译器: https://social.msdn.microsoft.com/Forums/en-US/e0ef4613-d90f-4eec-90db-41339ed31367/vs2010-ex$p$pss-and-missing-x64-compiler?forum=Vsex$p$pssinstall

3) VS2010 Express and missing x64 compiler: https://social.msdn.microsoft.com/Forums/en-US/e0ef4613-d90f-4eec-90db-41339ed31367/vs2010-express-and-missing-x64-compiler?forum=Vsexpressinstall

4)FIX:当您升级的Visual Studio 2010专业版或Visual Studio 2010例preSS到Visual Studio 2010 SP1如果安装了Windows SDK 7.1版的Visual C ++编译器中删除: http://support.microsoft.com/kb/2519277

4) FIX: Visual C++ compilers are removed when you upgrade Visual Studio 2010 Professional or Visual Studio 2010 Express to Visual Studio 2010 SP1 if Windows SDK v7.1 is installed: http://support.microsoft.com/kb/2519277

5)msvc9compiler.py:ValueError错误尝试编译VC防爆preSS时: http://bugs.python.org/ issue7511

5) msvc9compiler.py: ValueError when trying to compile with VC Express: http://bugs.python.org/issue7511

推荐答案

最后,我能得到点子运行。总而言之(从上面的信息冗余)这里是我做过什么,以intall 64位软件包的Python 3.3:

Ultimately I was able to get pip running. In a nutshell (and redundant from info above) here is what I did to intall 64-bit packages for python 3.3:

1)安装了Microsoft Visual C ++ 2010例preSS Download这里 (http://www.visualstudio.com/downloads/download-visual-studio-vs)

1) Installed Microsoft Visual C++ 2010 Express Download Here (http://www.visualstudio.com/downloads/download-visual-studio-vs)

2)安装微软SDK 7.1(Windows 7)中(http://www.microsoft.com/en-us/download/details.aspx?id=8279)

2) Installed Microsoft SDK 7.1 (Windows 7) (http://www.microsoft.com/en-us/download/details.aspx?id=8279)

内置 3)/启用在SDK中的64位工具。进入开始菜单,并在Microsoft Windows SDK v7.1的文件夹,选择Windows SDK 7.1命令提示符。一颗炮弹就上来了。键入以下命令 SETENV / 64

4)我安装了修订(不知道是不是最终需要的。)( http://support.microsoft。 COM / KB / 2519277 )

4) I installed a fix (don't know if it was ultimately needed.) (http://support.microsoft.com/kb/2519277)

5)创建在C一个新的vcvars64.bat文件:\程序文件(x86)\微软的Visual Studio 10.0 \ VC \ BIN \ AMD64。在那个新的批处理文件中我只包括行 CALLC:\ Program Files文件\微软的SDK \的Windows \ V7.1 \ BIN \ SetEnv.cmd/ 64 。我假定这是什么做的是部队的distutils使用C ++编译器的SDK。皮普后,这个正确安装。据我所知,C ++编译器必须是相同用​​于编译蟒蛇3.3。从我的研究,这似乎已安装的SDK是相同的编译器只是不要求的的原的vcvars64.bat文件是present。此信息来自:http://www.w7forums.com/threads/vcvarsall-bat-no-64bit-support-vcvars64-bat-missing.6606/ 。请纠正我,如果我创造下来的问题与此解决方案的道路。谢谢你。

5) Created a new vcvars64.bat file under C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64. Inside of that new batch file I included only the line CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64. I am assuming what this does is forces distutils to use the C++ compiler from the SDK. Pip installed correctly after this. As I understand, the C++ compiler has to be the same as that used to compile python 3.3. From my research, it seems that the SDK as installed is that same compiler but just doesn't require that the original vcvars64.bat file be present. This information came from: http://www.w7forums.com/threads/vcvarsall-bat-no-64bit-support-vcvars64-bat-missing.6606/ . Please correct me if I am creating problems down the road with this solution. Thanks.