下载旧版

https://sourceforge.net/projects/pywin32/files/pywin32/

下载新版

https://github.com/mhammond/pywin32/releases

源码安装出现下面报错,暂不推荐

RuntimeError: Can't find the Windows SDK

最简单的方法就是下载二进制文件

https://github.com/mhammond/pywin32/releases

查看python在注册表的路径

[HKEY_CURRENT_USER\Software\Python\Pythoncore\3.6\InstallPath]
@="C:\\Python26" [HKEY_CURRENT_USER\Software\Python\Pythoncore\3.6\PythonPath]
@="C:\\Python26;C:\\Python26\\Lib\\;C:\\Python26\\DLLs\\"

安装pywin32出现Python Version 3.6 required which was not found in the registry,表示注册表里没有python3.6的安装路径,出现这个问题是因为我是直接从另一台电脑拖过来的,不是正规安装

在注册表中写入python3.6的安装路径

解决方法

import sys
from winreg import * # tweak as necessary
version = sys.version[:3]
installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
installpath, installpath, installpath
) def RegisterPy():
try:
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
try:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
CloseKey(reg)
except:
print ("*** Unable to register!")
return
print (" Python", version, "is now registered!")
return
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
CloseKey(reg)
print ("=== Python", version, "is already registered!")
return
CloseKey(reg)
print ("*** Unable to register!")
print ("*** You probably have another Python installation!") if __name__ == "__main__":
RegisterPy()

然后再运行pywin32安装文件即可

windows安装pywin32的更多相关文章

  1. windows下安装pywin32报错:close failed in file object destructor:sys.excepthook is missing lost sys.stderr

    今晚要写搜索引擎作业,搭scrapy环境,遇到了下面问题: windows下安装pywin32报错:close failed in file object destructor:sys.excepth ...

  2. windows 安装 Scrapy的套路

    我最近在琢磨scrapy爬虫框架,在windows中安装scrapy遇到了不少坑:直接 pip install scrapy 安装不成功的,百度说要安装vc2008+等等,安装这些时间太长,最后找到一 ...

  3. Windows 安装 python2.7

    Windows 安装 python2.7 python2.7下载地址: https://www.python.org/downloads/release/python-2714/ 安装过程: 设置系统 ...

  4. 超简单Windows安装Scrapy (仅需一步)

    网上很多关于windows安装Scrapy的教程都非常的繁琐,请看我给大家分享的教程,非常简单 一步完成. 超简单的安装方法: 下载地址: https://www.continuum.io/downl ...

  5. scrapy windows 安装

    windows 7 系统下参照官网安装总是会提示出错,现在整理一下安装的流程 1.安装 python 2.7,添加环境变量 C:\Python27\;C:\Python27\Scripts\; 在 C ...

  6. python2在安装pywin32后出现ImportError: DLL load failed 解决方法

    python2在安装pywin32后出现ImportError: DLL load failed 解决方法 在python2中有时候会出现: import win32api   ImportError ...

  7. Mysql(windows)安装

    h3 { color: rgb(255, 255, 255); background-color: rgb(30,144,255); padding: 3px; margin: 10px 0px } ...

  8. Windows 安装JRuby 生成 war 到 tomcat 运行

    Windows安装JRuby Rails 直接下载 JRuby,不装 Ruby. http://jruby.org/download 该安装包可以配好环境变量 %JRUBY_HOME% 等 安装 bu ...

  9. windows安装rabbitmq

    官网下载windows安装版本:http://www.rabbitmq.com/install-windows.html ,安装文件rabbitmq-server-3.6.5.exe 前提:安装erl ...

随机推荐

  1. CONFIG_*头文件的配置

    通常在kernel或uboot中, 有很多以CONFIG_*开头的宏配置选项,并且保存在相应的头文件中,那么这些CONFIG_*是怎么生成的呢? 在uboot的顶层Makefile中,有这么一项: 此 ...

  2. 使用pycharm手动搭建python语言django开发环境(四) django中buffer类型与str类型的联合使用

    在django中,如果用到buffer类型时,buffer的编码格式是utf-8类型.使用str()进行转为字符串类型会异常. 异常会有如下提示:'ascii' codec can't decode ...

  3. ThreadLocal使用方法

      创建一个Bean,通过不同的线程对象设置Bean属性,保证各个线程Bean对象的独立性.   /**  * Created by IntelliJ IDEA.  * User: leizhimin ...

  4. gcc使用备忘

    本文为原创文章,转载请指明该文链接 Options Controling the kind of Output -x language 明确说明输入文件的编码语言,没有该选项的话, gcc 会根据输入 ...

  5. 记录下push推送优化改进点

    一)自主研发的push服务的特点及优势: 1) 消息回执确认(ack); 2) 有效期推送(设置消息的有效期); 3) 精准推送(设置设备组别推送); 4) 下发任务分解(拆分任务,多进程); 5) ...

  6. 第一百八十六节,jQuery,验证表单插件,Ajax 表单插件,验证和提交表单

    jQuery,验证表单插件,Ajax 表单插件,验证和提交表单 HTML <form id="reg" method="post" action=&quo ...

  7. Sublime 正则 替换方法

  8. Android自动化测试工具之—UiAutomator环境配置

    1.相关软件下载: 1)JDK: 1.6及其以上版本 2)Eclipse 3)Android SDK 其中Eclipse和Android SDK已经被Google打包成ADT(Android Deve ...

  9. 如何在MySQL客户端Navicat 上创建存储过程返回结果集

    下述引用自<MySQL 必知必会> MySQL命令行客户机的分隔符 如果你使用的是MySQL命令行实用程序,应该仔细阅读此说明.默认的MySQL语句分隔符为;(正如你已经在迄今为止所使用的 ...

  10. HTML学习笔记——常用元素及其属性(二)

    一.HTML表单 -- form标签 -- 与浏览者交互 1.form 标签 -- 代表HTML表单 form标签是成对出现的,以<form>开始,以</form>结束 属性. ...