使用 Pythonnet 导入 DLL 时出现“不是包”错误

问题描述

我正在尝试将一些 IronPython 代码移植到 Pythonnet,但出现 ModuleNotFoundError: No module named 'Arendi.BleLibrary'; 'Arendi' is not a package 错误

这是我正在做的事情:

import sys
sys.path.append("C:/Program Files (x86)/Folder_where_DLLs_Live")

import clr

clr.AddReference("Arendi.DotNETLibrary")
clr.AddReference("Arendi.DotNETLibrary.Windows")
clr.AddReference("log4net")
clr.AddReference("Newtonsoft.Json")
clr.AddReference("Arendi.BleLibrary")

import Arendi.DotNETLibrary
import Arendi.DotNETLibrary.Log
import log4net

import Arendi.BleLibrary.Local
Traceback (most recent call last):
  File "<stdin>",line 1,in <module>
ModuleNotFoundError: No module named 'Arendi.BleLibrary'; 'Arendi' is not a package

我已经使用 Dependencies 检查了依赖关系,我认为我很好。

我该如何调试? 这可能是构建 DLL 的方式吗?

谢谢!!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)