Pywintypes27.dll not found using Apache, Django, pywin32, Python2.7 and mod_wsgi

I have a Django application using django-mssql to communicate with SQL Server.

This works fine on the dev (runningerver) server, but in Apache / mod-wsgi I get an error related to it, trying to find the .dll that exists:

Exception Type: ImportError Exception Value: No system module 'pywintypes' (pywintypes27.dll) Exception Location: C:\Python27\lib\site-packages\win32\lib\pywintypes.py in __import_pywin32_system_module__, line 98 Python Executable: C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\httpd.exe 

I used ActivePython2.7.2, mod_wsgi, pywin32 Build 216 and Django1.3.1, all 32 bits

pywintypes27.dll exists in C: \ Windows \ SysWOW64 instead of C: \ Windows \ System32, as expected in my 64-bit Windows 7

Thank you in advance

This is the same question that django-mssql does not work in Apache w / mod-wsgi, but works fine in the dev server , but this answer did not help me because I installed 32 bits of pywin32, I am new to stackoverflow and hope that it is correct ask how a new question is, and not capture the flow of people.

+4
source share
2 answers

Move files:

  • pythoncom27.dll
  • pythoncomloader27.dll
  • pywintypes27.dll

from "C: \ Python27 \ Lib \ site-packages \ pywin32_system32"

to

"C: \ python27"

Hope this helps.

+16
source

Install pywin32-218.win32-py2.7.exe on machines with 32 or 64 bits.

0
source

All Articles