Меню

Pip install win32gui ошибка

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

m-rossi opened this issue

Oct 13, 2020

· 8 comments


Closed

Import win32ui broken on Python 3.9

#1593

m-rossi opened this issue

Oct 13, 2020

· 8 comments

Comments

@m-rossi

Expected behavior and actual behavior

Importing win32ui fails on Python 3.9

Steps to reproduce the problem

Install a version of Python 3.9, I used that from conda-forge:

conda create -n py39 python=3.9
conda activate py39
pip install pywin32
python
import win32ui
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed while importing win32ui: The specified module could not be found.

Version of Python and pywin32

Python 3.9.0 | packaged by conda-forge | (default, Oct 10 2020, 20:35:00) [MSC v.1916 64 bit (AMD64)] on win32
pip show pywin32
Name: pywin32
Version: 228

@m-rossi
m-rossi

changed the title
Import pywin32 broken on Python 3.9

Import win32ui broken on Python 3.9

Oct 13, 2020

@evandrix

@s-h-a-u-n

Similar issue with python 3.9 when installing 228 64bit from binaries and with 228 & 225 via PIP + post install script. win32ui is found but fails to import.

@evandrix

nvm, i switched over to uiautomation, which works brilliantly for my use case, so going to abandon pursuing this further and get on with the rest of 2020.

@char101

windbg traceback for LoadLibraryEx loading win32ui.pyd.

(5518.5d50): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
python39!_PyObject_GC_Alloc+0x11 [inlined in python39!_PyObject_GC_Malloc+0x20]:
00007ffe`77f2a450 488b5f10        mov     rbx,qword ptr [rdi+10h] ds:00000000`00000010=????????????????
0:000> k
 # Child-SP          RetAddr           Call Site
00 (Inline Function) --------`-------- python39!_PyObject_GC_Alloc+0x11 [C:A31sModulesgcmodule.c @ 2215] 
01 000000a9`881ff450 00007ffe`77f2c3d6 python39!_PyObject_GC_Malloc+0x20 [C:A31sModulesgcmodule.c @ 2252] 
02 000000a9`881ff480 00007ffe`77f3d6a0 python39!_PyObject_GC_NewVar+0x3a [C:A31sModulesgcmodule.c @ 2281] 
03 (Inline Function) --------`-------- python39!tuple_alloc+0x5a [C:A31sObjectstupleobject.c @ 92] 
04 (Inline Function) --------`-------- python39!PyTuple_New+0x63 [C:A31sObjectstupleobject.c @ 110] 
05 000000a9`881ff4b0 00007ffe`77f3e0ab python39!do_mktuple+0x94 [C:A31sPythonmodsupport.c @ 260] 
*** WARNING: Unable to verify checksum for R:test_load39win32ui.pyd
06 (Inline Function) --------`-------- python39!va_build_value+0xa3 [C:A31sPythonmodsupport.c @ 564] 
07 000000a9`881ff510 00000000`550921e0 python39!Py_BuildValue+0xbb [C:A31sPythonmodsupport.c @ 519] 
08 (Inline Function) --------`-------- win32ui!PyCCtrlView_Type::{ctor}+0x67 [t:testtest_pywin32pywin32pythonwinwin32control.h @ 30] 
09 000000a9`881ff560 00007ffe`cbbcbc0e win32ui!`dynamic initializer for 'PyCRichEditView::type''+0x70 [t:testtest_pywin32pywin32pythonwinwin32richedit.cpp @ 225] 
0a 000000a9`881ff5b0 00000000`5510203f ucrtbase!initterm+0x3e
0b 000000a9`881ff5e0 00000000`55102191 win32ui!dllmain_crt_process_attach+0xbb [f:ddvctoolscrtvcstartupsrcstartupdll_dllmain.cpp @ 67] 
0c 000000a9`881ff610 00007ffe`ce825021 win32ui!dllmain_dispatch+0x5d [f:ddvctoolscrtvcstartupsrcstartupdll_dllmain.cpp @ 190] 
0d 000000a9`881ff670 00007ffe`ce869385 ntdll!LdrpCallInitRoutine+0x65
0e 000000a9`881ff6e0 00007ffe`ce869178 ntdll!LdrpInitializeNode+0x1b1
0f 000000a9`881ff820 00007ffe`ce82aa17 ntdll!LdrpInitializeGraphRecurse+0x80
10 000000a9`881ff860 00007ffe`ce822511 ntdll!LdrpPrepareModuleForExecution+0xbf
11 000000a9`881ff8a0 00007ffe`ce822228 ntdll!LdrpLoadDllInternal+0x199
12 000000a9`881ff920 00007ffe`ce8216e4 ntdll!LdrpLoadDll+0xa8
13 000000a9`881ffad0 00007ffe`cbcd5630 ntdll!LdrLoadDll+0xe4
*** WARNING: Unable to verify checksum for R:test_load39test.exe
*** ERROR: Module load completed but symbols could not be loaded for R:test_load39test.exe
14 000000a9`881ffbc0 00007ff6`58f81016 KERNELBASE!LoadLibraryExW+0x170
15 000000a9`881ffc30 00007ff6`58f812e8 test+0x1016
16 000000a9`881ffc70 00007ffe`cd677bd4 test+0x12e8
17 000000a9`881ffcb0 00007ffe`ce86ce51 KERNEL32!BaseThreadInitThunk+0x14
18 000000a9`881ffce0 00000000`00000000 ntdll!RtlUserThreadStart+0x21

So what causes initialization failure is this line: https://github.com/mhammond/pywin32/blob/master/Pythonwin/win32control.h#L30 . Verified that if I comment out that line, win32ui loads fine.

Unfortunately I have no idea what those lines are doing so I cannot propose a fix.

@mhammond

That’s very helpful, thanks, and I can reproduce this in visual studio — I didn’t consider that an exception was being caught and ignored. Turns out we aren’t holding the GIL when we call back into Python — I’ve no idea why this is different in 3.9 vs other versions, but the fix is simple and is safe in all versions.

@char101

@mhammond

This is a wheel package I built for anyone that need it until an official package is released (rename .zip to .whl):

Thanks! Note that I just enabled 3.9 on CI, so every push will end up with wheels available as the artifacts of the CI run.

@CristiFati

m-rossi

added a commit
to regro-cf-autotick-bot/pywinauto-feedstock
that referenced
this issue

Jan 19, 2021

@m-rossi

-4 / 26 / 9

Регистрация: 06.03.2015

Сообщений: 209

1

22.10.2016, 15:52. Показов 9273. Ответов 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
Никак не хочет подключаться win32gui. Версия питона 3.6

&gt;&gt;&gt; import win32gui
Traceback (most…

Установка ПО. Ошибка 1622
Устанавливала ПО ActivInspire для интерактивной доски. На одну машину встала хорошо, а на другой…

Установка xorg (ошибка)
Добрый день.
Система чистая, поставил с мемстика вместе с сорцами. Вытащил все что было из портов….

установка win 7 ошибка
программе установки не удалось создать или найти существующий системный раздел

10

-4 / 26 / 9

Регистрация: 06.03.2015

Сообщений: 209

22.10.2016, 16:57

 [ТС]

3

pywin32 я скачал и установил. Мне нужно установить доп софт, в который входит win32gui.
Где я взял гайд



0



Эксперт Python

5403 / 3827 / 1214

Регистрация: 28.10.2013

Сообщений: 9,554

Записей в блоге: 1

22.10.2016, 18:58

4

Лучший ответ Сообщение было отмечено Dave_ как решение

Решение

А на какую версию python-а вы ставите? Для версий старше 3.3 используется не pywin32, а pypywin32 и в нем win32gui уже включен.

Ошибка #2 (установка 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



2738 / 2341 / 620

Регистрация: 19.03.2012

Сообщений: 8,832

22.10.2016, 19:19

7



1



-4 / 26 / 9

Регистрация: 06.03.2015

Сообщений: 209

22.10.2016, 20:06

 [ТС]

8

shsv,
alex925, от туда как раз и качал, и вот результат.
есть у кого ссылка на whl этого?

Цитата
Сообщение от Garry Galler
Посмотреть сообщение

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



У меня стоит Windows 11 с Python 3.10.0, pip 22.0.4. pywin32:

Name: pywin32
Version: 303
Summary: Python for Window Extensions
Home-page: https://github.com/mhammond/pywin32
Author: Mark Hammond (et al)
Author-email: mhammond@skippinet.com.au
License: PSF
Location: c:userserrmaappdataroamingpythonpython310site-packages
Requires:
Required-by:

При запуске pip install win32gui:

...
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "C:UserserrmaAppDataRoamingPythonPython310site-packagespip_vendorpep517in_process_in_process.py", line 363, in <module>
          main()
        File "C:UserserrmaAppDataRoamingPythonPython310site-packagespip_vendorpep517in_process_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:UserserrmaAppDataRoamingPythonPython310site-packagespip_vendorpep517in_process_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:UserserrmaAppDataLocalTemppip-build-env-7g6azkbvoverlayLibsite-packagessetuptoolsbuild_meta.py", line 177, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "C:UserserrmaAppDataLocalTemppip-build-env-7g6azkbvoverlayLibsite-packagessetuptoolsbuild_meta.py", line 159, in _get_build_requires
          self.run_setup()
        File "C:UserserrmaAppDataLocalTemppip-build-env-7g6azkbvoverlayLibsite-packagessetuptoolsbuild_meta.py", line 281, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:UserserrmaAppDataLocalTemppip-build-env-7g6azkbvoverlayLibsite-packagessetuptoolsbuild_meta.py", line 174, 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:UserserrmaAppDataLocalTemppip-install-q1m1y_iywin32gui_1bbf420bae6242c6b9530a842796097bwin32distutilsgui.py", line 6, in <module>
          from .command import win32_build_ext
      ModuleNotFoundError: No module named 'win32.distutils.command'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Буду рад любой помощи.

no module named win32gui

Hi forum,

i am still trying to get access to button presses on the touch screen.

It seems like the touch screen does register presses different to the mouse. By this, the press is only registered after the release. This is not what i want.

I found a hook which might help. However, at the moment i get the error message that there is no module named win32gui.

How do i solve this?

Is there win32 integrated in OpenSesame or do i need to install this?

I already downloaded this, but i am not sure where i have to put the file. Into the OpenSesame file with the .exe? And then, how do i make it run?

I tried:

import pip
pip.main(['install','pywin32‑225‑cp38‑cp38‑win_amd64.whl'])

I still get the error message. Probably i am doing wrong something simple. ?

Stephan

Howto: Installing pywin32 on Python 3.5.1 64-bit

Installing Python for Windows Extensions on Python 3.5.1 64-bit

C:>pip install pypiwin32

If you are getting the following error message in importing win32gui install VC++ 2010 redistributable.


>>> import win32gui
Traceback (most recent call last):
  File «<stdin>», line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.

Reference(s):
http://sourceforge.net/projects/pywin32/
https://www.python.org/downloads/

Popular posts from this blog

Press Alt+F1, then type: #: reboot -p Reference(s): https://groups.google.com/forum/#!topic/android-x86/pEI7xAnOpNY

Tried to update my Ubuntu host today and it did pickup that new version of VirtualBox is available (4.1.8). All other packages installed properly except that VirtualBox installation was complaining about missing dkms.conf file, see error message below. $: sudo /etc/init.d/vboxdrv setup * Stopping VirtualBox kernel modules [ OK ] * Uninstalling old VirtualBox DKMS kernel modules Error! Could not locate dkms.conf file. File: does not exist. [ OK ] * Trying to register the VirtualBox kernel modules using DKMS [ OK ] * Starting VirtualBox kernel modules [ OK ] Though it looks like installation was fine but I am concerned about its effects to VirtualBox functionality. To fix this, do: $: cd /var/lib/dkms/vboxhost $: sudo rm -r 4.1.4 $: sudo /etc/init.d/vboxdrv setup Of course you have to re

Say you have a document like below. And you want to split «hello world» into multiple lines. Doing this using Notepad++ is easy. Bring up Replace dialog ( Search | Replace… or CTRL+H ), in  Find what use hello worldrn . This matches the entire line including carriage return and linefeed character. In Replace with replace the string with the intended multi-line data, for example, hellornworldrn , will replace the line into two. One is hello , followed by world in the next line. And of course, for this to work you need to select Regular expression in the Search Mode .

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Pip install talib ошибка
  • Pip install socket ошибка