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:

相关推荐
郑州光合科技余经理12 小时前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
feifeigo12313 小时前
matlab画图工具
开发语言·matlab
dustcell.13 小时前
haproxy七层代理
java·开发语言·前端
norlan_jame13 小时前
C-PHY与D-PHY差异
c语言·开发语言
多恩Stone13 小时前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc
QQ40220549614 小时前
Python+django+vue3预制菜半成品配菜平台
开发语言·python·django
百锦再14 小时前
Django实现接口token检测的实现方案
数据库·python·django·sqlite·flask·fastapi·pip
QQ51100828514 小时前
python+springboot+django/flask的校园资料分享系统
spring boot·python·django·flask·node.js·php
QQ_196328847514 小时前
Python-flask框架西山区家政服务评价系统网站设计与开发-Pycharm django
python·pycharm·flask
遥遥江上月14 小时前
Node.js + Stagehand + Python 部署
开发语言·python·node.js