Search code examples
pythonimportpywin32

Cannot import win32ui with the correct version of pywin32 installed


I would like to import win32ui, win32con, win32api but none of them are showing up as being installed even tough I have the correct version of pywin32 installed(Python3.7, 64 bit same as python)

I have tried from win32 import win32ui etc. but besides for win32gui that did not work either

from win32 import win32gui #<---- This works
import win32ui, win32con, win32api #<---- This does not

Here is the error (I am importing the file that has the imports in it so that is why it looks like this, however if I run the file that has the imports in it directly it shows no errors)

Traceback (most recent call last):
  File "G:/_DEV/python/PythonPlaysAts/window_pos_test.py", line 2, in <module>
    from grabscreen import grab_screen
  File "C:\Users\Marci\AppData\Local\Programs\Python\Python37\lib\site-packages\grabscreen.py", line 6, in <module>
    import win32ui, win32con, win32api
ModuleNotFoundError: No module named 'win32ui'

Solution

  • Solution already mentioned here.Hope it helps u.. Python 'No module named win32gui' after installing pywin32

    Get the required win32 file if u need.. https://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/