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:

相关推荐
weixin199701080167 小时前
搜好货商品详情页前端性能优化实战
java·前端·python
临溟夜空的繁星7 小时前
C++ STL-- vector
开发语言·c++
王夏奇7 小时前
python-pytest学习
python·学习·pytest
BUG?不,是彩蛋!7 小时前
从 Q-Learning 到 LLM:我把 AI 的“大脑”换成了 GPT,发生了什么?
人工智能·python·gpt
XiYang-DING7 小时前
【Java SE】Java代码块详解
java·开发语言·python
摇滚侠7 小时前
Java SpringBoot 项目,项目启动后执行的方法,有哪些方式实现
java·开发语言·spring boot
chao_7897 小时前
【hello-agent】ReAct 第一个demo实践
python·agent·react-agent
艾莉丝努力练剑7 小时前
【Linux进程间通信:共享内存】为什么共享内存的 key 值由用户设置
java·linux·运维·服务器·开发语言·数据库·mysql
Reisentyan7 小时前
GoLang Learn Data Day 0
开发语言·rpc·golang