我已经将我的代码从C导出到我的导出.dll. 这个我的导出.dll反过来又取决于平台/qwindows.dll(夸脱)。与在同一目录中我的导出.dll在
以下是我使用ctypes的方式:
#myapp.py
from ctypes import *
mydll = WinDLL("myexported.dll")
mydll.independant_foo() #works fine
mydll.dependant_foo() #prompts the error and exits the program (python.exe)
运行脚本时:
^{pr2}$在调用需要qwindows.dll. 此时它会提示:
This application failed to start because it could not find or load the Qt platform plugin "windows". Available platform plugins are: minimal, offscreen, windows. Reinstalling the application may fix this problem.
我尝试了以下方法,但没有一个奏效:
唯一有效的例子就是复制“平台”/qwindows.dll“旁边python.exe文件在我的python文件夹中。在
有10个其他类似的DLL无法找到,除非它们位于python.exe文件。在
我怎么能强迫python.exe以查看我的app.py目录?在
我也有同样的问题。刚找到答案:error-when-loading-dll-from-a-different-directory-using-python-ctypes-cdl
简而言之,修改你的
os.environ['PATH']
。在相关问题 更多 >
编程相关推荐