views:

79

answers:

3

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?
A: 

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.

Ned Batchelder
@Ned what is a Windows kit for Pylons? By the way, I followed the instructions using the Pylons book.
J3M 7OR3
@Ned Also, once I have installed MinGW how do I build the extension? Is it just a matter of reinstalling Pylons after I have installed MinGW?
J3M 7OR3
+2  A: 

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.

ars
I got to the point where it says to download setuptools and then when I ran the installer for 2.7 it says that I need Python 2.7 but it can not find it in the registry. Very confusing because I have Python 2.7. Not sure what it means by registry. I also have Python 2.6 installed. Don't know if that is getting in the way or not.
J3M 7OR3
@J3M: from your question and pasted output, it seems you already have Python 2.7, setuptools/easy_install. So you don't need to follow those steps. Just steps 4 and 5 to get going with mingw should be sufficient.
ars
@ars well I did it and SimpleJSON got installed but I still got the same error. @pyfunc seems to know what they are talking about with getting disutils to use my compiler tool chain to build the needed 64 bit extensions. If this doesn't work out I am just going to switch to my Linux distro and bag Windows all together for dev purposes.
J3M 7OR3
+2  A: 

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 :

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]

http://serverfault.com/questions/114998/vista-cmd-shell-thinks-its-windows-server-2008-debug

pyfunc
I created the 2 directories but I do not understand what you mean by your last line: call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /Release ?
J3M 7OR3
@J3M 7OR3: See my edited answer above.
pyfunc
@pyfunc thanks for explaining why I need to take this step. I am still confused as to what I need to do. I did go to the link and saw that Olga mentioned the same path that you did but she also says stuff about setting INCLUDE, LIB, LIBPATH and PATH environment variables to point to the corresponding directories of the toolset you want to use. She basically lost me there. Do I have to do any of that? What do I place inside of the vcvarsamd64.bat directory? A file?
J3M 7OR3
@J3M 7OR3: Thats the job of SetEnv.cmd which comes as a part of MS SDK. Look for it or search for Microsoft Windows SDK for Windows Vista. Just add that in the batch file and this will set up all that for you.
pyfunc
@pyfunc Ahh. I understand. The problem is that I do not have a v7.1 dir, only a v6.0A dir. And with in the Bin in the v6.0A dir I have no SetEnv.cmd command that I can run. Should I download the latest SDK form here? http://msdn.microsoft.com/en-us/windows/bb980924.aspx or could that screw with my system?
J3M 7OR3
@J3M 7OR3: Ah, v7.1 dir is for windows 7. I think you should do find it some where. Please look at this SO discussion : http://stackoverflow.com/questions/887894/how-to-find-windows-sdks-setenv-cmd-setenv-cmd-does-not-work-correctly
pyfunc
@J3M 7OR3: Also can you try searching for SetEnv.* in the SDK directory
pyfunc
@pyfunc ok I searched C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin and I could not find SetEnv.cmd anywhere. Here are all the files I found http://pastie.org/1191341 Also when I try to find SetEnv.cmd by running 'where *.cmd" I get this http://pastie.org/1191352 and SetEnv.cmd is not there. So if I can not even locate it should I download it? If so which version/package?
J3M 7OR3
@pyfunc I looked at the server fault question and followed the instructions by @Jason to search for 'cmd' by going Start > Search. One cmd.exe appears in the search list. He doesn't say what to do next though. Also I should mention that I have Microsoft Visual c++ 2008 and Microsoft Visual Studio 2010 installed. Each of those have their own cmd.exe. Open Visual Studio 2008 Command Prompt and Open Visual Studio Command Prompt (2010). When I use any of those as well as well as my regular cmd.exe I can not locate SetEnv.cmd. There has got to be a solution.
J3M 7OR3