无法在 Pycharm 中使用来自 pywin32 的 win32gui 模块 [英] Not able to use the win32gui module from pywin32 in Pycharm

查看:410
本文介绍了无法在 Pycharm 中使用来自 pywin32 的 win32gui 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Pycharm 中使用 Python 3.7.我已经为这个项目安装了 pywin32 包,因为 win32api 与 Python 3.7+ 不兼容.

I'm using Python 3.7 with Pycharm. I've installed the pywin32 package for this project because win32api isn't compatible with Python 3.7+.

import win32con
import win32gui

我正在尝试在安装了 pywin32 的情况下导入这些模块,但这不起作用.问题仅在我卸载并重新安装 Pycharm 并且必须为该项目重新安装所有软件包后才开始发生.我正在使用与以前完全相同的解释器.为什么会发生这种情况?

I'm trying to import these modules with pywin32 installed but this doesn't work. The problem only started happening after I uninstalled and reinstalled Pycharm and had to reinstall all my packages for this project. I'm using the exact same interpreter as I was before. Why would this be happening?

推荐答案

有一个安装后步骤要遵循:

There is a post installation step to follow:

要安装 pywin32 系统文件,请从提升的命令提示符运行 python.exe Scripts/pywin32_postinstall.py -install.

To install pywin32 system files, run python.exe Scripts/pywin32_postinstall.py -install from an elevated command prompt.

你运行了这个命令吗?

另见https://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32

这篇关于无法在 Pycharm 中使用来自 pywin32 的 win32gui 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆