I’m trying to install win32gui with pip but I get an error:
C:\Users\משתמש>pip install win32gui
Collecting win32gui
Using cached https://files.pythonhosted.org/packages/b8/75/7bed82934e51903f9d48b26b3996161bb2dce1731607b4bb7fd26003ed3e/win32gui-221.5.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\temp\pip-install-ycidig8u\win32gui\setup.py", line 27, in <module>
from win32.distutils.gui import win32gui_build_ext
File "c:\temp\pip-install-ycidig8u\win32gui\win32\distutils\gui.py", line 6, in <module>
from .command import win32_build_ext
ModuleNotFoundError: No module named 'win32.distutils.command'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\temp\pip-install-ycidig8u\win32gui\
I’m using python 3.7
I’ve upgraded the setuptools but it is still not working…
martineau
120k25 gold badges170 silver badges303 bronze badges
asked Oct 14, 2018 at 20:40
1
Install pywin32. That gives you win32gui.
pip install pywin32
answered Jul 12, 2019 at 6:10
bronsonbronson
5,6623 gold badges31 silver badges18 bronze badges
1
Win32gui isn’t compatible with 3.7.
3.7 was realeased in 2018 and the latest version of win32gui was released in August 2017.
I would suggest installing 3.6 or lower as a workaround.
EDIT:
The answer by @bronson beat me to it by 9 days, but installing pywin32
with pip install pywin32
will install win32gui
alongside modules for interfacing with windows.
answered Oct 15, 2018 at 8:21
LegoroojLegorooj
2,6562 gold badges15 silver badges35 bronze badges
0
See this link: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32. It may be of help to you.
Step 1: Download the pywin32....whl
Step 2: pip install pywin32....whl
Step 3: C:\python32\python.exe Scripts\pywin32_postinstall.py -install
Step 4: python
>>> import win32gui
answered Oct 18, 2020 at 20:21
Erick AmoedoErick Amoedo
4751 gold badge4 silver badges9 bronze badges
All your needs you will satisfy in the module ctypes.
Use it and you won’t have any compatibility issues.
For example:
import ctypes
EnumWindows = ctypes.windll.user32.EnumWindows
GetWindowThreadProcessId = ctypes.windll.user32.GetWindowThreadProcessId
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, types.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int))
GetWindowText = ctypes.windll.user32.GetWindowTextW
GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW
IsWindowVisible = ctypes.windll.user32.IsWindowVisible
IsWindowEnabled = ctypes.windll.user32.IsWindowEnabled
answered Sep 2, 2021 at 4:17
I’m trying to install win32gui with pip but I get an error:
C:\Users\משתמש>pip install win32gui
Collecting win32gui
Using cached https://files.pythonhosted.org/packages/b8/75/7bed82934e51903f9d48b26b3996161bb2dce1731607b4bb7fd26003ed3e/win32gui-221.5.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\temp\pip-install-ycidig8u\win32gui\setup.py", line 27, in <module>
from win32.distutils.gui import win32gui_build_ext
File "c:\temp\pip-install-ycidig8u\win32gui\win32\distutils\gui.py", line 6, in <module>
from .command import win32_build_ext
ModuleNotFoundError: No module named 'win32.distutils.command'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\temp\pip-install-ycidig8u\win32gui\
I’m using python 3.7
I’ve upgraded the setuptools but it is still not working…
martineau
120k25 gold badges170 silver badges303 bronze badges
asked Oct 14, 2018 at 20:40
1
Install pywin32. That gives you win32gui.
pip install pywin32
answered Jul 12, 2019 at 6:10
bronsonbronson
5,6623 gold badges31 silver badges18 bronze badges
1
Win32gui isn’t compatible with 3.7.
3.7 was realeased in 2018 and the latest version of win32gui was released in August 2017.
I would suggest installing 3.6 or lower as a workaround.
EDIT:
The answer by @bronson beat me to it by 9 days, but installing pywin32
with pip install pywin32
will install win32gui
alongside modules for interfacing with windows.
answered Oct 15, 2018 at 8:21
LegoroojLegorooj
2,6562 gold badges15 silver badges35 bronze badges
0
See this link: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32. It may be of help to you.
Step 1: Download the pywin32....whl
Step 2: pip install pywin32....whl
Step 3: C:\python32\python.exe Scripts\pywin32_postinstall.py -install
Step 4: python
>>> import win32gui
answered Oct 18, 2020 at 20:21
Erick AmoedoErick Amoedo
4751 gold badge4 silver badges9 bronze badges
All your needs you will satisfy in the module ctypes.
Use it and you won’t have any compatibility issues.
For example:
import ctypes
EnumWindows = ctypes.windll.user32.EnumWindows
GetWindowThreadProcessId = ctypes.windll.user32.GetWindowThreadProcessId
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_bool, types.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int))
GetWindowText = ctypes.windll.user32.GetWindowTextW
GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW
IsWindowVisible = ctypes.windll.user32.IsWindowVisible
IsWindowEnabled = ctypes.windll.user32.IsWindowEnabled
answered Sep 2, 2021 at 4:17
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.
Comments
Describe the bug
Can’t install win32gui
via pip install win32gui
on Anaconda with Python 3.8.2
How can I reproduce this bug
Create a blank Python 3.8.2 Anaconda environment. In that environment, run the command pip install win32gui
.
What should have happened?
pip
should have installed win32gui
without any issues.
What is the error message?
CoconutMacaroon
changed the title
Buidling from source fails
Can’t install win32gui
May 1, 2020
Any solution? Same problem here on windows 10 .
My research
Sadly, I haven’t gotten it to work on the current version of Python. I found this https://stackoverflow.com/questions/52806906/cant-install-win32gui and tried that solution (in a Python 3.6 Anaconda environment), and it worked.
Solution (maybe)
However, answering your original question: try downloading Python 3.6 (rather than the latest Python), and see if that fixes it. Let me know if that works.
Fixed. Download python 3.6.X instead of the latest version as a fix.
Labels
bug
Something isn’t working
2 participants
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
1 |
|
22.10.2016, 15:52. Показов 10886. Ответов 10
Всем привет. По советам гугла скачал pywin32. После застрял на шаге установки доп компонентов, где нужно через командную строку установить файл pywin32_postinstall.py. В командную строку я ввел Код D:\Python\python.exe Scripts\pywin32_postinstall.py -install На что получил ошибку #2 (нету указанного файла). Проверил все ссылки, все правильно… Файл тоже существует по указанной ссылке.
0 |
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
22.10.2016, 16:57 [ТС] |
3 |
pywin32 я скачал и установил. Мне нужно установить доп софт, в который входит win32gui.
0 |
5412 / 3836 / 1214 Регистрация: 28.10.2013 Сообщений: 9,554 Записей в блоге: 1 |
|
22.10.2016, 18:58 |
4 |
РешениеА на какую версию python-а вы ставите? Для версий старше 3.3 используется не pywin32, а pypywin32 и в нем win32gui уже включен.
1 |
562 / 302 / 189 Регистрация: 20.05.2016 Сообщений: 592 |
|
22.10.2016, 18:58 |
5 |
Не нужен никакой доп. софт, win32gui — часть pywin32. pywin32_postinstall.py должен, если не ошибаюсь, запускаться автоматически. Он не устанавливает никаких дополнительных модулей и пр. в этом духе; он: копирует некоторые модули в системную папку, создаёт pth-файл, добавляет в контекстное меню питонячьих файлов пункт Edit with Pythonwin и т.д. … Что касается ошибки: укажите полный путь к pywin32_postinstall.py
1 |
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
22.10.2016, 19:15 [ТС] |
6 |
Версия у меня 3.5.1 . У тебя нету случайно ссылочки на whl файл?
0 |
2740 / 2339 / 620 Регистрация: 19.03.2012 Сообщений: 8,830 |
|
22.10.2016, 19:19 |
7 |
1 |
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
22.10.2016, 20:06 [ТС] |
8 |
shsv,
pypywin32
0 |
562 / 302 / 189 Регистрация: 20.05.2016 Сообщений: 592 |
|
22.10.2016, 20:48 |
10 |
Dave_, а скрипт Вам удалось запустить? Если, допустим, pywin32 установился, то, может быть, нет pywin32.pth в site-packages?
0 |
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
22.10.2016, 21:07 [ТС] |
11 |
Всем спасибо. Тему можно закрывать.
0 |