Python:no module named win32api

安装后win32模块无法使用
(1)使用管理员身份运行cmd

(2) 使用cd命令打开python的script文件夹

(3) 执行以下命令 python pywin32_postinstall.py -install

D:\Installed\python3.8.10\Scripts>python pywin32_postinstall.py -install
Parsed arguments are: Namespace(destination='D:\\Installed\\python3.8.10\\Lib\\site-packages', install=True, quiet=False, remove=False, silent=False, wait=None)
Copied pythoncom38.dll to C:\Windows\system32\pythoncom38.dll
Copied pywintypes38.dll to C:\Windows\system32\pywintypes38.dll
Registered: Python.Interpreter
Registered: Python.Dictionary
Registered: Python
-> Software\Python\PythonCore\3.8\Help[None]=None
-> Software\Python\PythonCore\3.8\Help\Pythonwin Reference[None]='D:\\Installed\\python3.8.10\\Lib\\site-packages\\PyWin32.chm'
Registered help file
Pythonwin has been registered in context menu
Creating directory D:\Installed\python3.8.10\Lib\site-packages\win32com\gen_py
Shortcut for Pythonwin created
Shortcut to documentation created
The pywin32 extensions were successfully installed.

D:\Installed\python3.8.10\Scripts>

可以看到在此路径下:D:\Installed\python3.8.10\Lib\site-packages\win32com\gen_py
在这里插入图片描述
将这三个文件复制到对应项目下正常导入

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值