Help: No module named 'pywintypes' when importing win32com.client

1,848 views
Skip to first unread message

tsk ng

unread,
Jan 12, 2021, 9:36:11 PM1/12/21
to spyder
HELP

My Spyder python version is 3.7.9. I tried to run `import win32com.client as win32` then I got the error below.

    Traceback (most recent call last):
    
      File "<ipython-input-1-360eab2b8977>", line 1, in <module>
        import win32com.client as win32
    
      File "C:\Users\abc\AppData\Local\Programs\Spyder\pkgs\win32com\__init__.py", line 6, in <module>
        import pythoncom
    
      File "C:\Users\abc\AppData\Local\Programs\Spyder\pkgs\pythoncom.py", line 2, in <module>
        import pywintypes
    
    ModuleNotFoundError: No module named 'pywintypes'


I copied these files (pythoncom38.dll + pywintypes38.dll + pythoncom37.dll and pywintypes37.dll) from 

C:\Users\"Your user id"\AppData\Roaming\Python\Python38\site-packages\pywin32_system32 

to 

C:\Users\"Your user id"\AppData\Roaming\Python\Python38\site-packages\win32\lib 

and 

C:\Users\"Your user id"\AppData\Roaming\Python\Python38\site-packages\win32

BUT I am getting the same error. 

Please help me out here. 

TM

unread,
Feb 4, 2021, 10:42:26 AM2/4/21
to spyder
I have exactly the same problem. I have tested it on two different PCs.

First I noticed it last Friday on my PC at work. I use "import win32com.client" to get data from the oscilloscope. The week before it worked with the same script. On the internet you can only find the hint to copy the above mentioned dll. Unfortunately this did not work for me either. Also a new installation remained without success.

Today I installed Spyder on my PC at home. I get the same error message.

Both PCs use Windows 10 in the 64bit variant.

Is it possible that a Windows update has made the win32com incompatible?
Reply all
Reply to author
Forward
0 new messages