python version-32 required_64位系統裝32位的Python,Python version 3.5 required, which was not found,DLL loa...

64位系統裝了32位的Python,安裝exe格式對應python版本相關的包,報錯:Python version 3.5 required, which was not found in the registry。

原因是注冊表缺少Python安裝信息,安裝時,要注意選擇。

64位系統32位Python,如果使用pywin32出現DLL load failed

復制文件夾

C:\Program Files (x86)\Python36-32\Lib\site-packages\pywin32_system32\

內的文件:pythoncom36.dll

pywintypes36.dll到文件夾C:\Windows\SysWOW64\

+++++++++++++++++++++++++++++++++++++++++

1.右鍵安裝包,“以管理員權限運行”

e8d5187159b78b85563b392743c3a8bf.png

2.勾選“add Python 3.5 to PATH”,選擇“customize installation”。

abdf9e47b5bf80c13180cd1f14a1774c.png

3.注意,勾選“for all users”就需要管理員權限運行。

ec6ffc85f0fe20815468aac553fa365c.png

4.勾選“Install for all users”,安裝。

32142dd42a05d457e923b5ad09e968a3.png

當然,你也可以選擇使用下面了py腳本來添加Python安裝信息:

import sys

from _winreg import *

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()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值