Python import error "DLL load failed" | Python
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! :)
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.
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.
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.
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
精彩评论