问题
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?
回答1:
From the error:
File "C:\Python27\Lib\distutils\msvc9compiler.py", line 295, in q
uery_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
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 :
- http://blogs.msdn.com/b/vcblog/archive/2007/12/30/using-different-toolsets-for-vc-build.aspx
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
回答2:
There's a workaround mentioned on pylons discuss list:
- simplejson workaround for Pylons 0.9.7 on Windows, Python 2.6
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.
回答3:
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.
回答4:
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.
回答5:
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.
来源:https://stackoverflow.com/questions/3827170/why-do-i-get-an-error-on-the-last-line-of-installing-pylons-1-0-with-easy-instal