windows安装pywin32
下载旧版
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的更多相关文章
- 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 ...
- windows 安装 Scrapy的套路
我最近在琢磨scrapy爬虫框架,在windows中安装scrapy遇到了不少坑:直接 pip install scrapy 安装不成功的,百度说要安装vc2008+等等,安装这些时间太长,最后找到一 ...
- Windows 安装 python2.7
Windows 安装 python2.7 python2.7下载地址: https://www.python.org/downloads/release/python-2714/ 安装过程: 设置系统 ...
- 超简单Windows安装Scrapy (仅需一步)
网上很多关于windows安装Scrapy的教程都非常的繁琐,请看我给大家分享的教程,非常简单 一步完成. 超简单的安装方法: 下载地址: https://www.continuum.io/downl ...
- scrapy windows 安装
windows 7 系统下参照官网安装总是会提示出错,现在整理一下安装的流程 1.安装 python 2.7,添加环境变量 C:\Python27\;C:\Python27\Scripts\; 在 C ...
- python2在安装pywin32后出现ImportError: DLL load failed 解决方法
python2在安装pywin32后出现ImportError: DLL load failed 解决方法 在python2中有时候会出现: import win32api ImportError ...
- Mysql(windows)安装
h3 { color: rgb(255, 255, 255); background-color: rgb(30,144,255); padding: 3px; margin: 10px 0px } ...
- Windows 安装JRuby 生成 war 到 tomcat 运行
Windows安装JRuby Rails 直接下载 JRuby,不装 Ruby. http://jruby.org/download 该安装包可以配好环境变量 %JRUBY_HOME% 等 安装 bu ...
- windows安装rabbitmq
官网下载windows安装版本:http://www.rabbitmq.com/install-windows.html ,安装文件rabbitmq-server-3.6.5.exe 前提:安装erl ...
随机推荐
- Spring+SpringMVC+MyBatis+Maven框架整合
本文记录了Spring+SpringMVC+MyBatis+Maven框架整合的记录,主要记录以下几点 一.Maven需要引入的jar包 二.Spring与SpringMVC的配置分离 三.Sprin ...
- Xcode7中你一定要知道的炸裂调试神技【转载】
Xcode7中苹果为我们增加了两个重要的debug相关功能.了解之后觉得非常实用,介绍给大家. 1.Address Sanitizer: 妈妈再也不用担心 EXC_BAD_ACCESS EXC_BAD ...
- PHPstorm配置远程及本地服务器
首先打开PHPStorm的设置. 找到如下页面 OPEN一个项目,路径为XAMPP的安装路径 选择Local or mounted folder 设置以上属性,upload/download proj ...
- 深度历险:Redis 内存模型详解
https://mp.weixin.qq.com/s/Gp6Ur7omGY6ZqDWygU2meQ Redis 是目前最火爆的内存数据库之一,通过在内存中读写数据,大大提高了读写速度,可以说 Redi ...
- golang解析json
解析json,在很多语言都是很常用的,go提供了相应的包"encoding/json"来处理.直接上代码,如下: package main import ( "encod ...
- 去除Android打开软件出现的红边框
/********************************************************************** * 去除Android打开软件出现的红边框 * 说明: ...
- with root cause 解决办法
现象:1.工程在启动的时候无异常,当页面加载到包含spring:message标签的页面时,在后台报空指针异常,同时控制 台会显示with root cause提示: 2. ...
- Eclipse Debug 调试
Debug 调试 Java 程序 我们可以在 Package Explorer 视图调试 Java 程序,操作步骤如下: 鼠标右击包含 main 函数的 java 类 选择 Debug As > ...
- github+hexo+node.js搭建个人博客基本过程及遇到的问题
一,所需工具 1,github账号+Gitclient+配置SSH key 2,安装node.js. 3,安装Hexo. 当中,github pages是我们用来部署我们本地的博客到github上的. ...
- merge实现拉链表
建表如下( 历史拉链表): 新表(每日更新的): 实现语句: MERGE INTO test_target t1 USING ( SELECT nvl(c.id, b.id) AS id ,CASE ...