python调用qt编写的dll

报错:FileNotFoundError: Could not find module 'F:\pythonProject\MINGW\sgp4Lib.dll' (or one of its dependencies). Try using the full path with constructor syntax.

只有两种情况:

1.路径不对

2.库的依赖不全

1、如果是使用了qt库的,必须将所有依赖项拷贝到Python工程中。

方法1:使用depends walker

方法2:使用windeployqt.exe 打包 找到所有依赖项。结果可能很大 ,可以试着删掉一些不需要的,删了,不影响正常调用dll,就是可以删掉的。

python 复制代码
import ctypes



# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print(platform.architecture())
    dll = ctypes.cdll.LoadLibrary(r'F:/pythonProject/MINGW/xxxLib.dll')#

如果返回json格式,可以参考如下:

qt:

Python:

相关推荐
一勺菠萝丶15 分钟前
macOS 安装 Python 包报错:`externally-managed-environment` 怎么解决?
python
醒李44 分钟前
盲人出行辅助系统原型
人工智能·python·目标检测
有点。1 小时前
C++(枚举法一练习题)
开发语言·c++·算法
Klong.k1 小时前
如何避免Bean的线程安全问题
java·开发语言
接着奏乐接着舞1 小时前
【无标题】
开发语言·前端·javascript
iiiiyu1 小时前
集合进阶(Map集合)
java·大数据·开发语言·数据结构·编程语言
PILIPALAPENG1 小时前
第4周 Day 3:多 Agent 协作——让 Agent 们"组队干活"
前端·人工智能·python
AoDeLuo1 小时前
SOEM2.0编译与Qt调用
qt·机器视觉