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:

相关推荐
SilentSamsara12 小时前
迭代器协议:`__iter__` / `__next__` 的完整执行流程
开发语言·人工智能·python·算法·机器学习
yuanpan12 小时前
Python + psutil 实战:开发一个简易系统监控工具
linux·运维·python
平凡但不平庸的码农12 小时前
Go Channel详解
开发语言·后端·golang
laomocoder12 小时前
Project-Nexus-WAN-跨公网Agent对话
开发语言·php
子安柠12 小时前
深入理解 Go 语言文件操作:从基础到最佳实践
开发语言·后端·golang
代码中介商12 小时前
C++文件流操作全解析
开发语言·c++
Forget_855012 小时前
RHEL——Kubernetes容器编排平台(二)
java·开发语言
Achou.Wang12 小时前
go语言中使用等待组(waitgroups)和内存屏障(barriers)进行同步
开发语言·后端·golang
MATLAB代码顾问12 小时前
【智能优化】鹈鹕优化算法(POA)原理与Python实现
开发语言·python·算法
lsx20240612 小时前
C 标准库 - `<stdio.h>`
开发语言