Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

visual studio 2008 - Errors while building/installing C module for Python 2.7

I'm trying getting the following errors while trying to install/compile ctools for python (version info)

ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win32
  • OS: Windows 7 Professional 64-bit (Service Pack 1)
  • Installed: Microsoft Visual C++ 2008 Express Edition

Error:

building 'deap.cTools' extension
Traceback (most recent call last):
  File "setup.py", line 40, in <module>
    cmdclass = {'build_py': build_py}
  File "C:Python27libdistutilscore.py", line 152, in setup
    dist.run_commands()
  File "C:Python27libdistutilsdist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:Python27libdistutilsdist.py", line 972, in run_command
    cmd_obj.run()
  File "C:Python27libdistutilscommandinstall.py", line 563, in run
    self.run_command('build')
  File "C:Python27libdistutilscmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:Python27libdistutilsdist.py", line 972, in run_command
    cmd_obj.run()
  File "C:Python27libdistutilscommanduild.py", line 127, in run
    self.run_command(cmd_name)
  File "C:Python27libdistutilscmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:Python27libdistutilsdist.py", line 972, in run_command
    cmd_obj.run()
  File "C:Python27libdistutilscommanduild_ext.py", line 340, in run
    self.build_extensions()
  File "C:Python27libdistutilscommanduild_ext.py", line 449, in build_extensions
    self.build_extension(ext)
  File "C:Python27libdistutilscommanduild_ext.py", line 499, in build_extension
    depends=ext.depends)
  File "C:Python27libdistutilsmsvc9compiler.py", line 473, in compile
    self.initialize()
  File "C:Python27libdistutilsmsvc9compiler.py", line 383, in initialize
    vc_env = query_vcvarsall(VERSION, plat_spec)
  File "C:Python27libdistutilsmsvc9compiler.py", line 299, in query_vcvarsall
    raise ValueError(str(list(result.keys())))
ValueError: [u'path']

I've installed PyWin as suggested in here, but it didn't help. I'd appreciate help sorting out this issue.

Edit

Same issue arises when trying to install scikit-learn

  File "C:Python27libdistutilsmsvc9compiler.py", line 299, in query_vcvarsall
    raise ValueError(str(list(result.keys())))
ValueError: [u'path']
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I summarized above in my blog. http://springflex.blogspot.com/2014/02/how-to-fix-valueerror-when-trying-to.html

To install Visual Studio 2008 Express Edition with all required components:

  1. Install Microsoft Visual Studio 2008 Express Edition. The main Visual Studio 2008 Express installer is available from (the C++ installer name is vcsetup.exe):

  2. Install the Microsoft Windows SDK. The Microsoft Windows SDK is available by searching Microsoft's download site, or by going directly to: http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en

  3. To verify that you have all installed components, check that the Microsoft SDK contains the "amd64" version of the C/C++ compiler "cl.exe". This is usually installed into

    C:Program Files (x86)Microsoft Visual Studio 9.0VCinamd64cl.exe
    
  4. copy .../VC/bin/vcvars64.bat to .../VC/bin/vcvarsamd64.bat

  5. copy .../VC/bin/vcvars64.bat to .../VC/bin/amd64/vcvarsamd64.bat


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...