Python 3.8 上 ctypes 加载 DLL 库抛出异常 FileNotFoundError: Could not find module 'node.dll'

本文原发于笔者在 Github 上的项目 Issue 讨论中 (https://github.com/ynyyn/Miniblink-Python-SimpleDemo/issues/4),系笔者在 Python 3.8 上测试项目兼容性时觉察到的 Python 行为(与兼容性)变更。

现象

使用 Python 3.8 ctypes 加载 DLL 库,采用相对路径加载,如下写法所示:

mb = ctypes.cdll.LoadLibrary("node.dll") 

启动时抛出 FileNotFoundError 异常,提示 Could not find module 'node.dll'. Try using the full path with constructor syntax.

Exception in thread Thread-1:
Traceback (most recent call last):
  File "...\Python38\lib\threading.py", line 932, in _bootstrap_inner
 ...

阅读全文>>

27823 次浏览 0 条评论 标签:Windows Python ctypes dll
Ɣ回顶部