import win32ui in python 3.6

Weizen picture Weizen · Oct 3, 2017 · Viewed 8.4k times · Source

I downloaded pywin32 from the website. I've got those imports:

from pywin32 import win32gui
from pywin32 import win32ui
from pywin32 import win32con

It doesn't work at all, but the first import works if i replace pywin32 with win32. Like this

from win32 import win32gui
from pywin32 import win32ui
from pywin32 import win32con

For the second one i've got this error

ModuleNotFoundError: No module named 'pywin32'

What should i do?

Answer

逆さま picture 逆さま · Oct 3, 2017

pywin32 doesn't expose a module named pywin32. Instead, it separates out into multiple modules that map to various parts of the Windows API.

So for you, the import statements should look like:

from win32 import win32gui
import win32ui
import win32con