Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Value error trying to install Python for Windows extensions

I have Microsoft Visual Studio 2008 installed already. I downloaded the zip file Python for Windows extensions and extracted the contents into my Python27 folder. There's now a subfolder called pywin32-214. (Is the 32 part a problem? I'm on a 64-bit system.) Here's a transcript from the command line:

C:\Python27\pywin32-214>setup.py -q install Building pywin32 2.7.214.0 Traceback (most recent call last):   File "C:\Python27\pywin32-214\setup.py", line 2152, in <module>     ('', ('pywin32.pth',)),   File "C:\Python27\lib\distutils\core.py", line 152, in setup     dist.run_commands()   File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands     self.run_command(cmd)   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command     cmd_obj.run()   File "C:\Python27\pywin32-214\setup.py", line 1251, in run     install.run(self)   File "C:\Python27\lib\distutils\command\install.py", line 563, in run     self.run_command('build')   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command     self.distribution.run_command(command)   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command     cmd_obj.run()   File "C:\Python27\pywin32-214\setup.py", line 596, in run     build.run(self)   File "C:\Python27\lib\distutils\command\build.py", line 127, in run     self.run_command(cmd_name)   File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command     self.distribution.run_command(command)   File "C:\Python27\lib\distutils\dist.py", line 972, in run_command     cmd_obj.run()   File "C:\Python27\lib\distutils\command\build_ext.py", line 340, in run     self.build_extensions()   File "C:\Python27\pywin32-214\setup.py", line 858, in build_extensions     self.compiler.initialize()   File "C:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize     vc_env = query_vcvarsall(VERSION, plat_spec)   File "C:\Python27\lib\distutils\msvc9compiler.py", line 299, in query_vcvarsal l     raise ValueError(str(list(result.keys()))) ValueError: [u'path'] 

I don't know what to make of this. Help?

like image 258
user460847 Avatar asked Jan 13 '11 04:01

user460847


2 Answers

Another possible reason for this problem to appear is that you have just installed Visual Studio and the command prompt you're using had been hanging around from the time before the installation.

This is because MSVC installer sets few environment variables and one of these variables ( VS90COMNTOOLS )has to be set for vcvarsall.bat to execute correctly. But each running program in Windows holds its own local copy of environment variables that gets inherited (copied) from parent process upon child start-up. Thus, after child has started, it does not receive alterations performed on the system-level envvars. And the only way of getting updated environment variables is trough spawning a new instance of a child process with parent that has updated version of envvars.

like image 76
Ilya Avatar answered Sep 20 '22 04:09

Ilya


If you have a 64 bit Python installation:

Install "Microsoft Visual Studio 2008 Professional Edition" with the "X64 Compiler and Tools" option enabled.

Alternatively, download pywin32-214.win-amd64-py2.7.exe from http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/

like image 27
cgohlke Avatar answered Sep 23 '22 04:09

cgohlke