码迷,mamicode.com
首页 > 编程语言 > 详细

windows下pip安装python module失败

时间:2017-01-22 15:15:26      阅读:441      评论:0      收藏:0      [点我收藏+]

标签:open   traceback   http   prompt   blog   rac   visual   环境   uil   

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‘]

  

1. 下载相关的 Python for Windows Extensions 相关版本,并安装。

  https://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/

2.  设置 VS90COMNTOOLS 环境变量

  1. Finding vcvarsx86_amd64.bat in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64 (depends on your setup)
  2. Open a cmd prompt
  3. Run SET VS90COMNTOOLS=%VS120COMNTOOLS% (depends on setup, seehttp://stackoverflow.com/a/10558328/2362877)
  4. Run vcvarsx86_amd64.bat
  5. Then pip install <package>

 

参考:

  http://stackoverflow.com/questions/4676728/value-error-trying-to-install-python-for-windows-extensions

 

windows下pip安装python module失败

标签:open   traceback   http   prompt   blog   rac   visual   环境   uil   

原文地址:http://www.cnblogs.com/doscho/p/6340133.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!