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:

相关推荐
whatever who cares1 分钟前
Java/Android中BigDecimal的相关操作
android·java·开发语言
环己酮5 分钟前
py数据科学学习笔记day4-空间数据统计分析与可视化(2)
python
普通网友22 分钟前
嵌入式C++安全编码
开发语言·c++·算法
烤麻辣烫27 分钟前
黑马程序员苍穹外卖(新手) DAY3
java·开发语言·spring boot·学习·intellij-idea
q***482531 分钟前
基于python语言的网页设计(手把手教你设计一个个人博客网站)
开发语言·python
妮妮喔妮32 分钟前
JAVA反射的介绍(优缺点)
java·开发语言
云知谷35 分钟前
【软件测试】《集成测试全攻略:Mock/Stub 原理 + Postman/JUnit/TestNG 实战》
c语言·开发语言·c++·软件工程·团队开发
qq_22589174661 小时前
基于Python+Django餐饮评论大数据分析与智能推荐系统 毕业论文
开发语言·后端·python·信息可视化·数据分析·django
普通网友1 小时前
分布式锁服务实现
开发语言·c++·算法
普通网友1 小时前
移动语义在容器中的应用
开发语言·c++·算法