pywin32的安装
来源:互联网 发布:淘宝 比较好的手机店 编辑:程序博客网 时间:2024/05/01 22:10
下载地址:
https://sourceforge.net/projects/pywin32/
根据你的电脑是32位的还是64位的,还有根据你的python版本是多少来决定。
在这里,我的选择的是pywin32-221.win-amd64-py3.6安装遇到的问题,python version 3.6 required,which was not found in the registr
是因为安装的python权限是对所有人,则没有添加到注册表中,故执行下列代码,可以解决。
from __future__ import print_functionimport systry: from winreg import *except ImportError: from _winreg import *# tweak as necessaryversion = sys.version[:3]installpath = sys.prefixregpath = "SOFTWARE\\Python\\Pythoncore\\{0}\\".format(version)installkey = "InstallPath"pythonkey = "PythonPath"pythonpath = "{0};{1}\\Lib\\;{2}\\DLLs\\".format( 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()
3,问题2:ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。
表示python版本的位数与安装模块包的位数不相同导致的。
4,安装成功
阅读全文
0 0
- pywin32的安装
- python -- pywin32安装
- pywin32不能安装解决方案
- pywin32中安装问题
- pywin32模块安装方法
- 安装pywin32报错
- 安装Pywin32出现错误
- python安装pywin32问题
- python安装pywin32出现DLL load failed的解决办法
- 已安装pywin32却找不到pywintypes的解决方案
- python 3.6 安装 PyUserInput 的依赖包pywin32
- Python pyHook和pythoncom和pywin32的下载安装教程
- pywin32
- pywin32
- python3.5 安装 pywin32模块
- pywin32不能安装如何解决
- 【原创】Vista以上系统安装RobotFramework的注意事项(python安装pywin32也遇到了)
- pycharm 虚拟环境如何手动安装第三方包(附带pywin32在windows的安装)
- mongodb相关语句
- 类式继承和原型链继承,并分析二者的优缺点
- 线程的生命周期
- C语言入门参考(一)
- 【机器配置】python与C混合编程注意机器与平台的位数
- pywin32的安装
- spark 2.1 安装
- 8月17日小结
- Failed to resolve: junit:junit:4.12解决方案
- Linux内核定时器
- Muduo 设计与实现之一:Buffer 类的设计
- 我教你使用Spring Cloud和Docker构建微服务
- 关于windows server 2008 ftp搭建
- mysql------基础及常见SQL技巧