8

I'm serving a Django app behind IIS6 web server.

The test server runs perfectly, but when running behind the web server a module failes to import I get this error:

Error loading pyodbc module: DLL load failed: The specified module could not be found


Just for the record the module is pyodbc

The site is served though isapi by using isapi-wsgi


Any ideas? It would really make my day! :)

RadiantHex
  • 24,907
  • 47
  • 148
  • 244
  • I have no answer only that after spending a huge amount of time both googling and trying myself I had to give up on using IIS. However, it's running fine using apache instead. – PhoebeB Nov 01 '10 at 14:11
  • 3
    Have you checked with dependencywalker if all dlls are ok? – luc Nov 01 '10 at 14:13
  • I have the same issue: `ImportError: DLL load failed: The specified procedure could not be found.` when `import pyodbc` on a Windows 10 machine. I am new with windows - how do I check the dependencies with dependencywalker ? – NoIdeaHowToFixThis Jun 01 '17 at 12:30

4 Answers4

4

This error is a PITA: it is often caused by missing symbols in dll (because a dependent dll was not found, etc...). You should check the .pyd with dependency walker, or look into the windows log which may log such errors depending on your configuration.

David Cournapeau
  • 78,318
  • 8
  • 63
  • 70
1

I have recently been battling with setting up Django/Python on IIS 7 on Windows 2008 with MS SQL 2008. I bumped into the same problem as you did. I was using PyODBC-2.1.8. I compiled the modules from source. I used the mingw compiler to compile them from source. Nothing worked.

I then downgraded to PyODBC-2.1.7. And it worked! I used the binary available from the site for the Python 2.6 distribution (that is the version of Python I am using).

I hope this may help.

ayaz
  • 10,406
  • 6
  • 33
  • 48
0

In my case I had installed pyodbc for 64-bits on a 32-bit OS. Both versions are available here.

I'm hoping I'm not the only one stupid enough to do this and this might help someone.

James Bradbury
  • 1,708
  • 1
  • 19
  • 31
0

dowload the latest "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019" from the links at

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Milad Hatami
  • 1,494
  • 13
  • 18