下载旧版

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. 83. Remove Duplicates from Sorted List【easy】

    83. Remove Duplicates from Sorted List[easy] Given a sorted linked list, delete all duplicates such ...

  2. AudioToolKit的简单介绍及教程

    AudioToolKit的简单介绍及教程 (2013-02-21 09:29:18) 转载▼ 标签: 游戏开发 unity3d教程 unity3d unity it 分类: Unity3d之插件篇 原 ...

  3. Havel--Hakimi定理推断可图化 python

    介绍: 哈维尔[1955]--哈吉米[1962]算法能够用来判读一个度序列d是否是可图化的. 哈维尔[1955]--哈吉米[1962]定理: 对于N > 1,长度为N的度序列d可以可图化当且仅当 ...

  4. zookeeper安装笔记

    安装zookeeper,将zookeeper上传到三个服务器,保存在/usr/local/zookeeper目录下,解压tar包 tar -xzvf zookeeper-3.4.6.tar.gz 进入 ...

  5. FastDFS单机搭建以及java客户端Demo

    http://blog.csdn.net/u012453843/article/details/69951920 http://blog.csdn.net/xyang81/article/detail ...

  6. eclipse 配置JDK

    JDK安装成功,eclipse也安装成功,这时候实际上是可以不配置JDK,因为系统已经默认给你配置好了,但是下面的情况需要配置:1.你系统中安装了多个JDK,某个项目工程需要更高版本的JDK等 工具/ ...

  7. Working with JSON in C# & VB

    Introduction Whilst JSON is a compact and easy to read cross-language storage and data exchange form ...

  8. day3笔记

    一.内容回顾 1.break:停止当前循环,后面的程序不会运行,跳出循环. 跳出while循环:1,改变条件.2.break continue:结束本次循环,继续下一次循环. 2.格式化输出:%%可以 ...

  9. 如何学习TP框架

    1.学习访问方法 2.控制器的写法 3.视图的写法 4.模型的写法 5.扩展类的用法 6.扩展插件的用法

  10. 关于spring MVC中加载多个validator的方法。

    首先讲下什么叫做validator: validator是验证器,可以验证后台接受的数据,对数据做校验. SpringMVC服务器验证有两种方式,一种是基于Validator接口,一种是使用Annot ...