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:temppip-install-ycidig8uwin32guisetup.py", line 27, in <module>
from win32.distutils.gui import win32gui_build_ext
File "c:temppip-install-ycidig8uwin32guiwin32distutilsgui.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:temppip-install-ycidig8uwin32gui
I’m using python 3.7
I’ve upgraded the setuptools but it is still not working…
martineau
119k25 gold badges165 silver badges294 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,4521 gold badge30 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,6262 gold badges15 silver badges34 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:python32python.exe Scriptspywin32_postinstall.py -install
Step 4: python
>>> import win32gui
answered Oct 18, 2020 at 20:21
Erick AmoedoErick Amoedo
4551 gold badge3 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:UsersViraj 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:usersviraj sharmaappdatalocalprogramspythonpython38python.exe' 'c:usersviraj sharmaappdatalocalprogramspythonpython38libsite-packagespip_vendorpep517_in_process.py' get_requires_for_build_wheel 'C:UsersVIRAJS~1AppDataLocalTemptmpjn8lvta1'
cwd: C:UsersViraj SharmaAppDataLocalTemppip-install-gcbm1r68win32gui
Complete output (20 lines):
Traceback (most recent call last):
File "c:usersviraj sharmaappdatalocalprogramspythonpython38libsite-packagespip_vendorpep517_in_process.py", line 280, in <module>
main()
File "c:usersviraj sharmaappdatalocalprogramspythonpython38libsite-packagespip_vendorpep517_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:usersviraj sharmaappdatalocalprogramspythonpython38libsite-packagespip_vendorpep517_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "C:UsersViraj SharmaAppDataLocalTemppip-build-env-9wmd0fzaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 149, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:UsersViraj SharmaAppDataLocalTemppip-build-env-9wmd0fzaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 130, in _get_build_requires
self.run_setup()
File "C:UsersViraj SharmaAppDataLocalTemppip-build-env-9wmd0fzaoverlayLibsite-packagessetuptoolsbuild_meta.py", line 253, in run_setup
super(_BuildMetaLegacyBackend,
File "C:UsersViraj SharmaAppDataLocalTemppip-build-env-9wmd0fzaoverlayLibsite-packagessetuptoolsbuild_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:UsersViraj SharmaAppDataLocalTemppip-install-gcbm1r68win32guiwin32distutilsgui.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:usersviraj sharmaappdatalocalprogramspythonpython38python.exe' 'c:usersviraj sharmaappdatalocalprogramspythonpython38libsite-packagespip_vendorpep517_in_process.py' get_requires_for_build_wheel 'C:UsersVIRAJS~1AppDataLocalTemptmpjn8lvta1' Check the logs for full command output.
Trying to install win32gui
Hey, 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:temppip-install-ycidig8uwin32guisetup.py», line 27, in <module>
from win32.distutils.gui import win32gui_build_ext
File «c:temppip-install-ycidig8uwin32guiwin32distutilsgui.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:temppip-install-ycidig8uwin32gui
I’ve upgraded the setuptools but it is still not working… Help?
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
1 |
|
22.10.2016, 15:52. Показов 10638. Ответов 10
Всем привет. По советам гугла скачал pywin32. После застрял на шаге установки доп компонентов, где нужно через командную строку установить файл pywin32_postinstall.py. В командную строку я ввел Код D:Pythonpython.exe Scriptspywin32_postinstall.py -install На что получил ошибку #2 (нету указанного файла). Проверил все ссылки, все правильно… Файл тоже существует по указанной ссылке.
0 |
Programming Эксперт 94731 / 64177 / 26122 Регистрация: 12.04.2006 Сообщений: 116,782 |
22.10.2016, 15:52 |
Ответы с готовыми решениями: Не подключается win32gui >>> import win32gui Установка ПО. Ошибка 1622 Установка xorg (ошибка) установка win 7 ошибка 10 |
-4 / 26 / 9 Регистрация: 06.03.2015 Сообщений: 209 |
|
22.10.2016, 16:57 [ТС] |
3 |
pywin32 я скачал и установил. Мне нужно установить доп софт, в который входит win32gui.
0 |
5407 / 3831 / 1214 Регистрация: 28.10.2013 Сообщений: 9,554 Записей в блоге: 1 |
|
22.10.2016, 18:58 |
4 |
Сообщение было отмечено Dave_ как решение РешениеА на какую версию 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 |
@will7200 After updating I was able to run the gui and have it pop up, but the bot still doesn’t seem to do anything but click around randomly. Is there a certain location my nox window needs to be, or is it reading directly from memory? Here’s what the log is showing:
Z:python35Yugioh-bot>python main.py gui -s Z:python35Yugioh-botlibsite-packagesh5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from
floatto
np.floatingis deprecated. In future, it will be treated as
np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters 2018-01-15 22:04 - DEBUG - bot - Value last_run_at modified to 2018-01-15 14:55:48.388847 2018-01-15 22:04 - INFO - apscheduler.scheduler - Adding job tentatively -- it will be properly scheduled when the scheduler starts 2018-01-15 22:04 - DEBUG - bot - Timeout dump Scheduled 2018-01-15 22:04 - DEBUG - bot - Value next_run_at modified to 2018-01-15 18:56:19.864582 2018-01-15 22:04 - INFO - apscheduler.scheduler - Removed job b7763fd89dda48b9bd495933cfabe23b 2018-01-15 22:04 - INFO - apscheduler.scheduler - Adding job tentatively -- it will be properly scheduled when the scheduler starts 2018-01-15 22:04 - DEBUG - bot - Timeout dump Scheduled 2018-01-15 22:04 - DEBUG - bot - Watching Z:python35Yugioh-botrunTimeOptions.json for runTime Options 2018-01-15 22:04 - INFO - apscheduler.scheduler - Added job "DuelLinkRunTime.dump" to job store "default" 2018-01-15 22:04 - INFO - apscheduler.scheduler - Scheduler started 2018-01-15 22:04 - DEBUG - bot - Value next_run_at modified to 2018-01-15 22:04:02.954196 2018-01-15 22:04 - INFO - apscheduler.scheduler - Removed job 6da4d283115c4356880dec68dbbb98d0 2018-01-15 22:04 - INFO - apscheduler.scheduler - Added job "DuelLinkRunTime.dump" to job store "default" 2018-01-15 22:04 - DEBUG - bot - Timeout dump Scheduled 2018-01-15 22:04 - INFO - apscheduler.scheduler - Added job "DuelLinkRunTime.main.<locals>.in_main" to job store "default" 2018-01-15 22:04 - INFO - bot - Tracking Z:python35Yugioh-botrunTimeOptions.json 2018-01-15 22:04 - INFO - bot - Next run at 2018-01-15T22:04:02.954196 PyQt5.QtCore.QRect(0, 40, 1360, 728) PyQt5.QtCore.QRect(0, 0, 1360, 768) 2018-01-15 22:04 - INFO - apscheduler.executors.default - Running job "DuelLinkRunTime.main.<locals>.in_main (trigger: date[2018-01-15 22:04:02 CST], next run at: 2018-01-15 22:04:02 CST)" (scheduled at 2018-01-15 22:04:02.954196-06:00) 2018-01-15 22:04 - INFO - apscheduler.scheduler - Removed job cron_main_at_2018-01-15T22:04:02.954196 2018-01-15 22:04 - DEBUG - bot - Value last_run_at modified to 2018-01-15 22:04:02.954884 2018-01-15 22:04 - INFO - apscheduler.scheduler - Removed job 7aeb824b3e3d4c458809f9698db8a827 2018-01-15 22:04 - INFO - apscheduler.scheduler - Added job "DuelLinkRunTime.dump" to job store "default" 2018-01-15 22:04 - DEBUG - bot - Timeout dump Scheduled 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - INFO - bot - starting auto play through 2018-01-15 22:04 - INFO - bot.provider.Nox - starting auto run through 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Run through 1 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - INFO - apscheduler.executors.default - Running job "DuelLinkRunTime.dump (trigger: date[2018-01-15 22:04:07 CST], next run at: 2018-01-15 22:04:07 CST)" (scheduled at 2018-01-15 22:04:07.956388-06:00) 2018-01-15 22:04 - INFO - apscheduler.scheduler - Removed job a5ed93b4399940128344259e8edb078a 2018-01-15 22:04 - DEBUG - bot - Dump Getting Called {'last_run_at': datetime.datetime(2018, 1, 15, 22, 4, 2, 954884), 'playmode': 'autoplay', 'next_run_at': datetime.datetime(2018, 1, 15, 22, 4, 2, 954196), 'run_now': False, 'stop': False, 'battle_calls': {'beforeEnd': [], 'beforeStart': [], 'afterStart': [], 'afterEnd': []}} 2018-01-15 22:04 - INFO - apscheduler.executors.default - Job "DuelLinkRunTime.dump (trigger: date[2018-01-15 22:04:07 CST], next run at: 2018-01-15 22:04:07 CST)" executed successfully 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Tapping at location (348,640) 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - INFO - bot.provider.Nox - NPC Battle Mode,Points: (348,640) at location: (1), message: failure/Back-Button 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Tapping at location (28.846153846153847,767.5384615384615) 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR CLOSE BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOK FOR WORD 'OK', HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Tapping at location (170,582) 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR CLOSE BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOK FOR WORD 'OK', HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Tapping at location (330,338) 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - INFO - bot.provider.Nox - NPC Battle Mode,Points: (330,338) at location: (1), message: failure/Back-Button 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Tapping at location (30.666666666666668,768.3333333333334) 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR CLOSE BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOK FOR WORD 'OK', HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:04 - DEBUG - bot.provider.Nox - Tapping at location (66,604) 2018-01-15 22:05 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:05 - DEBUG - bot.provider.Nox - LOOKING FOR CLOSE BUTTON, HIGH CORRERLATION 2018-01-15 22:05 - DEBUG - bot.provider.Nox - LOOK FOR WORD 'OK', HIGH CORRERLATION 2018-01-15 22:05 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:05 - DEBUG - bot.provider.Nox - Tapping at location (264,588) 2018-01-15 22:05 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION 2018-01-15 22:05 - DEBUG - bot.provider.Nox - LOOKING FOR BACK BUTTON, HIGH CORRERLATION --- Logging error --- Traceback (most recent call last): File "Z:python35Yugioh-botliblogging__init__.py", line 983, in emit stream.write(self.terminator) OSError: raw write() returned invalid length 180 (should have been between 0 and 90) Call stack: File "Z:python35Yugioh-botlibthreading.py", line 891, in _bootstrap self._bootstrap_inner() File "Z:python35Yugioh-botlibthreading.py", line 923, in _bootstrap_inner self.run() File "Z:python35Yugioh-botlibthreading.py", line 871, in run self._target(*self._args, **self._kwargs) File "Z:python35Yugioh-botlibconcurrentfuturesthread.py", line 66, in _worker work_item.run() File "Z:python35Yugioh-botlibconcurrentfuturesthread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "Z:python35Yugioh-botlibsite-packagesapschedulerexecutorsbase.py", line 125, in run_job retval = job.func(*job.args, **job.kwargs) File "Z:python35Yugioh-botbotduel_links_runtime.py", line 368, in in_main self.determine_playthrough(provider) File "Z:python35Yugioh-botbotduel_links_runtime.py", line 327, in determine_playthrough provider.auto() File "Z:python35Yugioh-botbotprovidersprovider.py", line 52, in auto self.scan() File "Z:python35Yugioh-botbotprovidersnoxnox.py", line 294, in scan loop_scan(self.compare_with_back_button, **{'info': dl_info}) File "Z:python35Yugioh-botbotproviderscommon.py", line 13, in loop_scan doit = fn(**kwargs) File "Z:python35Yugioh-botbotprovidersnoxnox.py", line 181, in compare_with_back_button self.root.debug("LOOKING FOR BACK BUTTON, {} CORRERLATION".format(corrword)) Message: 'LOOKING FOR BACK BUTTON, HIGH CORRERLATION' Arguments: () 2018-01-15 22:06 - DEBUG - bot.provider.Nox - LOOKING FOR CLOSE BUTTON, HIGH CORRERLATION 2018-01-15 22:06 - DEBUG - bot.provider.Nox - LOOK FOR WORD 'OK', HIGH CORRERLATION