Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your req

错误:[Python] 加载WindPy出现"[WinError 126]

Traceback (most recent call last):

return self._dlltype(name)

File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__

self._handle = _dlopen(self._name, mode)

WindowsError: [Error 126]

原因分析:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your req_第1张图片

错误场景

用flask开发web程序,特殊需求调用dll库。当时dll库存放路径就在项目的根目录,部署在本地apache上面跑一切正常,哥们拿着代码部署环境一样,永远报上面这个错误。

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your req_第2张图片

解决方法:

上图这样加载库的方式就需要把dll放在python环境的根目录,还可以写出dll文件的全路径。

你可能感兴趣的:(Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your req)