为什么在 Windows Vista 64 中使用 easy_install 和 Python 2.7 安装 Pylons 1.0 的最后一行会出现错误?
我尝试在 Windows Vista 64 中使用 easy_install
命令安装 Pylons 1.0 和 Python 2.7,但收到错误:
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
这是命令提示符下整个安装过程的链接 http://pastie.org/1190341
- 为什么会出现此错误?
- 我该如何解决?
- 即使我收到此错误,Pylons 还能工作吗?
I tried to install Pylons 1.0 with Python 2.7 using the easy_install
command in Windows Vista 64 but got the error:
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
Here is the link to the whole installation process from command prompt
http://pastie.org/1190341
- Why do I get this error?
- How do I solve it?
- Will Pylons work even though I got this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从错误中:
distutils 查找名为 vcvarsall.bat 的文件。它运行它并获取批处理文件设置的 include 和 lib 目录。批处理文件根据您提供给它的平台来设置环境。
vcvarsall.bat 应位于以下目录中:C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
创建以下目录:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
在 vcvarsamd64.bat 中
调用“C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd” /x64 /Release
以上所有内容都设置了 Windows 工具链以与 disutils 一起使用。虽然您可能有 64 位 python,但 pypi 上的大多数软件包都附带 32 位预编译的二进制文件。 disutils 需要使用您的编译器工具链来构建 64 位扩展。这就是所有这一切出现的地方。
请查看:
vcvarsamd64.bat 和其他批处理文件的作用是设置可供 disutils 使用的库、工具等的路径。
[编辑:在 v6 中找不到 setenv.cmd]
https:/ /serverfault.com/questions/114998/vista-cmd-shell-thinks-its-windows-server-2008-debug
From the error:
distutils looks for a file called vcvarsall.bat. It runs it and gets the include and lib directories that the batch file sets up. The batch file sets up the environment based on what platform you supply to it.
vcvarsall.bat should be in a directory like: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
Create following directories:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
in vcvarsamd64.bat
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /Release
All these above sets up windows tool chain to work with disutils. While you may have 64 bit python, most packages on pypi comes with 32 bit precompiled binaries. disutils needs to use your compiler tool chain for building 64 bit extensions. This is where all this come into picture.
Please look at :
What vcvarsamd64.bat and other batchfile does is setup up paths for libs, tools etc which can be used by disutils.
[Edit: setenv.cmd not found in v6]
https://serverfault.com/questions/114998/vista-cmd-shell-thinks-its-windows-server-2008-debug
pylons 讨论列表中提到了一个解决方法:
有点旧(2008),但由于您粘贴的输出显示编译 simplejson 失败,所以它似乎是相关的。您可以尝试按照那里的建议进行操作,看看是否有帮助。
There's a workaround mentioned on pylons discuss list:
It's a bit old (2008), but since your pasted output shows failure on compiling simplejson, it seems relevant. You might try following the suggestions there to see if it helps.
如果您已经安装了x64 Visual Studio,则可以使用开始菜单中Visual Studio工具中的cmd工具。它将为您设置环境。
if you have installed x64 visual studio you can use the cmd tool in the visual studio tools in the start menu. It will set up the environment for you.
看起来您无法构建 C 扩展,这对于 Windows 用户来说通常很困难。尝试寻找 Pylons 的 Windows 套件。或者,寻求有关安装 MinGW 的帮助,以便您可以构建扩展。
It looks like you couldn't build a C extension, something that is often difficult for Windows users. Try to find a Windows kit for Pylons. Or, look for help on installing MinGW so you can build the extensions.
我花费了大量时间尝试让 C++ 编译器在 64 位 Windows 上使用 64 位 Python。原来答案就在这里。
http://msdn.microsoft.com/en- us/library/ms246588(v=vs.90).aspx
再次运行 VS 2008 Professional 安装程序,并确保在安装程序选项中选择“X64 编译器和工具”。
I spent a huge amount of time trying to get the c++ compiler to work with 64 bit Python on 64 bit Windows. It turns out the answer was here.
http://msdn.microsoft.com/en-us/library/ms246588(v=vs.90).aspx
Run the VS 2008 Professional installer again and make sure make sure "X64 Compilers and Tools" is selected in the installer options.