0

I just upgraded to Python 3.8.2. Following the upgrade I reinstalled a few packages that I use frequently by

python -m pip install --upgrade pip
pip install -U wxPython
pip install pywin32
pip install python-vlc
pip install PyAutoIt

Now I find that I can no longer create COM objects. A minimal example is

import win32com.client
aut = win32com.client.Dispatch("AutoItX3.Control")

This results in

Traceback (most recent call last):
  File "C:\Python\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch
    IDispatch = pythoncom.connect(IDispatch)
pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\testwin32.py", line 2, in <module>
    aut = win32com.client.Dispatch("AutoItX3.Control")
  File "C:\Python\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221164, 'Class not registered', None, None)

Is this a problem with Python 3.8.2, win32com, or is there something I need to re-initialize?

1 Answers1

1

Found the problem. When I installed Python 3.8.2 I grabbed a 32 bit version. I re-installed using the 64 bit version and the problem went away.