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:

相关推荐
河阿里2 分钟前
Lambda表达式(Java):从语法本质到工程实践
java·开发语言
步步为营DotNet4 分钟前
深入探究.NET 11 中.NET Aspire 在云原生应用持续集成与交付安全加固
python
MATLAB代码顾问13 分钟前
MATLAB实现粒子群算法优化PID参数
开发语言·算法·matlab
Soari16 分钟前
深度办公革命:拆解 Claude for Microsoft 365,打造金融级智能办公生态
python·microsoft·金融·flask
陈天伟教授17 分钟前
图解人工智能(1)居里点
大数据·开发语言·人工智能·gpt
chao18984421 分钟前
Qt Modbus TCP 通讯源码
qt·tcp/ip·命令模式
.唉27 分钟前
06. FastAPI框架从入门到实战
python·fastapi·web
大鹏说大话34 分钟前
Kotlin vs Java:Android之外,后端开发该怎么选?
开发语言
276695829240 分钟前
某白山小程序限制PC端调试
python·小程序·apache·小程序逆向·某白山·限制pc调试
skywalker_1140 分钟前
注解和反射
java·开发语言