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:

相关推荐
萤火阳光17 小时前
43|Python 异步生态深度:aiohttp/aiomysql/aioredis 全链路异步实战
开发语言·网络·python
妖萌妹儿18 小时前
postman怎么做参数化批量测试,测试不同输入组合
开发语言·javascript·postman
酉鬼女又兒18 小时前
零基础快速入门前端ES6 核心特性详解与蓝桥杯 Web 考点实践(可用于备赛蓝桥杯Web应用开发)
开发语言·前端·职场和发展·蓝桥杯·es6·css3·html5
威联通安全存储18 小时前
云原生数据湖:QuObjects 本地 S3 对象存储解析
python·云原生
计算机安禾18 小时前
【数据结构与算法】第23篇:树、森林与二叉树的转换
c语言·开发语言·数据结构·c++·线性代数·算法·矩阵
chushiyunen18 小时前
大模型评测、质量保证、datasets数据集、LmEval工具
开发语言·python
伯恩bourne18 小时前
SpringDoc OpenAPI 3 常用注解详解
java·开发语言
ab12376818 小时前
C++ size() 与 length() 核心笔记
开发语言·c++·笔记
新知图书18 小时前
【图书推荐】《Python大数据分析师的算法手册》
python·数据分析
apcipot_rain18 小时前
Python 脚本生成目录树
开发语言·python