[python-win32] Unable to find PythonCOM20.dll

Rogelio Flores rogelio.flores at gmail.com
Wed Jul 14 23:56:45 CEST 2004


I'm running into a weird behavior (unless I'm able to find an
explanation with your help) from Mark Hammond's win32 extensions.

This is what I'm trying to do:
I want to distribute only the modules/libraries/files needed for a
simple interaction with excel that my program uses. I know what I need
to include, but I get this error:

Traceback (most recent call last):
    import win32com.client
  File "C:\sviews\rxf_IQ_v4\cadiq\cadiq\modules\plat-win32\win32com\client\__init__.py",
line 12, in ?
    import dynamic, gencache, pythoncom
  File "C:\sviews\rxf_IQ_v4\cadiq\cadiq\modules\plat-win32\win32com\client\dynamic.py",
line 22, in ?
    import pythoncom
  File "C:\sviews\rxf_IQ_v4\cadiq\cadiq\modules\plat-win32\pythoncom.py",
line 3, in ?
    pywintypes.__import_pywin32_system_module__("pythoncom", globals())
  File "C:\sviews\rxf_IQ_v4\cadiq\cadiq\modules\plat-win32\pywintypes.py",
line 41, in __import_pywin32_system_module__
    h = win32api.LoadLibrary(filename)
pywintypes.api_error: (126, 'LoadLibrary', 'The specified module could
not be found.')

I know it looked for pywintypes20.dll (really PyWinTypes20.dll on
disk) successfully first, and this file is located in the same
directory as PythonCOM20.dll. The directory in question is included in
sys.path at run-time, but still, it finds PyWinTypes20.dll  and not
PythonCOM20.dll.

I tried replacing "pythoncom" for "PythonCOM" inside pywintypes.py
without success. Then I renamed  PythonCOM20.dll to pythoncom.dll and
now it works. Can somebody explain this?

I'm using (and must use) python 2.0 and the files from
win32all-144.exe (win32 extensions). Actually, the problem could be
that I wasn't able to find a pywintypes.py or a pythoncom.py in this
installer and so I used the ones from the python23 installation that I
have because it win32com/client/dynamic.py is asking for pythoncom.py.
Is there actually a way to run this without pythoncom.py and
pywintypes.py and just assume that both dlls are there?

Any help would be appreciated. Please reply off the list. Thanks,


--
Rogelio


More information about the Python-win32 mailing list