[python-win32] pywintypes assert sys.modules[modname] is old_mod

Roger Upole rupole at hotmail.com
Thu Jun 28 22:28:10 CEST 2012


Jim Carroll wrote:
> I'm running django1.2.4 against mssql, using sqlserver_ado,and pywin32 v214
> and it runs for a few hours, then starts failing with:
>
>
> File "C:\\Python27\\lib\\site-packages\\django_mssql-1.0.0.dev_unknown-
> py2.7.egg\\sqlserver_ado\\dbapi.py", line 41, in <module>   import pythoncom
> File "C:\\Python27\\lib\\site-packages\\pythoncom.py", line 2, in <module>
> import pywintypes File "C:\\Python27\\lib\\site-
> packages\\win32\\lib\\pywintypes.py", line 124, in <module>
> __import_pywin32_system_module__("pywintypes", globals()) File
> "C:\\Python27\\lib\\site-packages\\win32\\lib\\pywintypes.py", line 114, in
> __import_pywin32_system_module__   assert sys.modules[modname] is old_mod
>
>
>
>>From what I've read, going back to version 212 solves the problem,  so
> I'm trying that now.   I was using 214
>
> It seems like there must be two similar dlls loading, and the
> second to load is failing.  Can anyone tell me which dll in
> particular I can look for duplicates of, maybe I can blindly
> find all version on the machine, and replace older versions
> with the latest.
>
> Thanks!

Look for duplicate versions of pywintypes27.dll or pythoncom27.dll,
most likely in the python installation and your System32 directory.

      Roger





More information about the python-win32 mailing list