繁体   English   中英

我尝试使用 pip 安装 win32gui,但出现此错误。 我正在使用 python 3.8.5,我也有最新版本的 pip

[英]I tried installing win32gui using pip but I'm getting this error. I am using python 3.8.5, I have latest version of pip too

C:\Users\Viraj Sharma>pip install win32gui Collecting win32gui Using cached win32gui-221.5.tar.gz (605 kB) Installing build dependencies ... done Getting requirements to build wheel ... error ERROR: Command errored out with exit status 1: command: 'c:\users\viraj sharma\appdata\local\programs\python\python38\python.exe' 'c:\users\viraj sharma\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\VIRAJS~1\AppData\Local\Temp\tmpjn8lvta1' cwd: C:\Users\Viraj Sharma\AppData\Local\Temp\pip-install-gcbm1r68\win32gui Complete output (20 lines): Traceback (most recent call last): File "c:\users\viraj sharma\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module> main() File "c:\users\viraj sharma\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "c:\users\viraj sharma\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py", line 114, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\Viraj Sharma\AppData\Local\Temp\pip-build-env-9wmd0fza\overlay\Lib\site-packages\setuptools\build_meta.py", line 149, in get_requires_for_build_wheel return self._get_build_requires( File "C:\Users\Viraj Sharma\AppData\Local\Temp\pip-build-env-9wmd0fza\overlay\Lib\site-packages\setuptools\build_meta.py", line 130, in _get_build_requires self.run_setup() File "C:\Users\Viraj Sharma\AppData\Local\Temp\pip-build-env-9wmd0fza\overlay\Lib\site-packages\setuptools\build_meta.py", line 253, in run_setup super(_BuildMetaLegacyBackend, File "C:\Users\Viraj Sharma\AppData\Local\Temp\pip-build-env-9wmd0fza\overlay\Lib\site-packages\setuptools\build_meta.py", line 145, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 27, in <module> from win32.distutils.gui import win32gui_build_ext File "C:\Users\Viraj Sharma\AppData\Local\Temp\pip-install-gcbm1r68\win32gui\win32\distutils\gui.py", line 6, in <module> from .command import win32_build_ext ModuleNotFoundError: No module named 'win32.distutils.command' ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\viraj sharma\appdata\local\programs\python\python38\python.exe' 'c:\users\viraj sharma\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\VIRAJS~1\AppData\Local\Temp\tmpjn8lvta1' Check the logs for full command output.

Python 3.7 或 3.8 与 win32gui 不兼容。

3.8于2019年发布,最新版win32gui于2017年8月发布。

我建议使用 python 3.6 或更低版本来让 installiton 正常工作。

但是,还有一个替代方案,通过安装 (pip install pywin32) 将安装 win32gui 以及用于与 Windows 接口的模块。

您可以使用以下命令安装 win32gui。

pip install pywin32

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM