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:

相关推荐
m0_738120727 小时前
网络安全编程——Python编写基于UDP的主机发现工具(解码IP header)
python·网络协议·tcp/ip·安全·web安全·udp
北冥有羽Victoria8 小时前
OpenCLI 操作网页 从0到1完整实操指南
vscode·爬虫·python·github·api·ai编程·opencli
handsomestWei8 小时前
scikit-learn数据预处理模块
python·机器学习·scikit-learn
w_t_y_y8 小时前
机器学习常用的python包(二)工具箱scikit-learn
python·机器学习·scikit-learn
用户8356290780518 小时前
Python 自动拆分 Word 文档教程:按分节符与分页符处理
后端·python
十五年专注C++开发8 小时前
Oat++: 一个轻量级、高性能、零依赖的 C++ Web 框架
开发语言·c++·web服务·oatpp
陈天伟教授8 小时前
心电心音同步分析-案例:原型设计一
开发语言·人工智能·python·语言模型·架构
我的xiaodoujiao8 小时前
API 接口自动化测试详细图文教程学习系列9--Requests模块
python·学习·测试工具·pytest
Allen_LVyingbo8 小时前
量子计算Dirac Notation基本教学—从零基础到读懂量子信息论文(下)
开发语言·人工智能·python·数学建模·量子计算
wjs20248 小时前
Ruby File 类和方法
开发语言