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:

相关推荐
枯萎穿心攻击3 分钟前
响应式编程入门教程第二节:构建 ObservableProperty<T> — 封装 ReactiveProperty 的高级用法
开发语言·unity·c#·游戏引擎
Eiceblue1 小时前
【免费.NET方案】CSV到PDF与DataTable的快速转换
开发语言·pdf·c#·.net
m0_555762902 小时前
Matlab 频谱分析 (Spectral Analysis)
开发语言·matlab
浪裡遊3 小时前
React Hooks全面解析:从基础到高级的实用指南
开发语言·前端·javascript·react.js·node.js·ecmascript·php
烛阴4 小时前
简单入门Python装饰器
前端·python
lzb_kkk4 小时前
【C++】C++四种类型转换操作符详解
开发语言·c++·windows·1024程序员节
好开心啊没烦恼4 小时前
Python 数据分析:numpy,说人话,说说数组维度。听故事学知识点怎么这么容易?
开发语言·人工智能·python·数据挖掘·数据分析·numpy
面朝大海,春不暖,花不开4 小时前
使用 Python 实现 ETL 流程:从文本文件提取到数据处理的全面指南
python·etl·原型模式
简佐义的博客4 小时前
破解非模式物种GO/KEGG注释难题
开发语言·数据库·后端·oracle·golang