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:

相关推荐
先知后行。16 小时前
python的类
开发语言·python
派大鑫wink16 小时前
【Day12】String 类详解:不可变性、常用方法与字符串拼接优化
java·开发语言
JIngJaneIL16 小时前
基于springboot + vue健康管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot·后端
dyxal16 小时前
Python包导入终极指南:子文件如何成功调用父目录模块
开发语言·python
nnerddboy16 小时前
解决传统特征波段选择的不可解释性:2. SHAP和LIME
python·机器学习
电商API&Tina16 小时前
【电商API接口】关于电商数据采集相关行业
java·python·oracle·django·sqlite·json·php
我居然是兔子16 小时前
Java虚拟机(JVM)内存模型与垃圾回收全解析
java·开发语言·jvm
weixin_4215850117 小时前
解释代码:val_pred = vxm_model.predict(val_input)--与tensor对比
python
小许好楠17 小时前
java开发工程师-学习方式
java·开发语言·学习
xwill*17 小时前
python 字符串拼接
linux·windows·python