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:

相关推荐
菜鸡儿齐39 分钟前
Unsafe方法学习
java·python·学习
老师好,我是刘同学4 小时前
Python执行命令并保存输出到文件
python
啵啵鱼爱吃小猫咪6 小时前
机械臂阻抗控制github项目-mujoco仿真
开发语言·人工智能·python·机器人
似水明俊德6 小时前
02-C#
开发语言·c#
MaximusCoder6 小时前
等保测评命令——Centos Linux
linux·运维·经验分享·python·安全·centos
yunyun321236 小时前
用Python生成艺术:分形与算法绘图
jvm·数据库·python
m0_662577976 小时前
高级爬虫技巧:处理JavaScript渲染(Selenium)
jvm·数据库·python
oem1106 小时前
C++中的享元模式实战
开发语言·c++·算法
songyuc6 小时前
【PyTorch】感觉`CrossEntropyLoss`和`BCELoss`很类似,为什么它们接收labels的shape常常不一样呢?
人工智能·pytorch·python
似水明俊德6 小时前
01-C#.Net-泛型-面试题
java·开发语言·面试·c#·.net