pyinstaller EXE OS错误:找不到或加载spatialindex_c-64.dll [英] pyinstaller EXE OSError: could not find or load spatialindex_c-64.dll

查看:518
本文介绍了pyinstaller EXE OS错误:找不到或加载spatialindex_c-64.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Window 10 64bit创建exe.但是,exe出现以下错误:文件"rtree \ core.py",第126行,位于OSError:找不到或加载spatialindex_c-64.dll[23324]无法执行脚本microwave_python_code

I am using Window 10 64bit to create exe. However, the exe gives error below: File "rtree\core.py", line 126, in OSError: could not find or load spatialindex_c-64.dll [23324] Failed to execute script microwave_python_code

我尝试了以下ppl共享的解决方案,但仍然无法解决问题.

I tried below solutions ppl shared but still cannot solve the problem.

  1. -add-data = C:\ path \ to \ spatialindex_c-64.dll;.到我的构建命令
  2. pip卸载rtree,然后使用"Rtree-0.9.4-cp37-none-win_amd64.whl"进行安装
  3. 安装"spatialindex-src-1.9.3.tar.gz"
  4. 将"spatialindex_c-64.dll"复制到rtee站点程序包文件夹中
  5. 将"spatialindex_c-64.dll"复制到exe文件夹中

任何人都可以通过上述操作来创建可运行的exe吗?尝试上述解决方案后,我仍然面临问题.我还能做些什么来使我的exe正常工作?

Anyone able to create working exe by doing above? I still face problem after trying above solutions. Anything else that I can do to get my exe works?

推荐答案

我遇到了同样的问题,并使用

I had the same issue, and I solved it using the final answer on http://pyinstaller.47505.x6.nabble.com/OSError-while-running-exe-td2997.html.

要解决此问题,请找到在构建.exe时创建的 .specs 文件,并向其中添加两件事:

To solve it, find the .specs file that is made when building the .exe, and add two things to it:

from PyInstaller.utils.hooks import collect_dynamic_libs
...
a = Analysis(...
            binaries=collect_dynamic_libs("rtree"),
            ...)

这将找到 rtree 使用的 .dll 文件.之后,您可以使用命令 pyinstaller your_script_name.spec 重建它.

That will find the .dll files used by rtree. After that, you can rebuild it with the command pyinstaller your_script_name.spec.

这篇关于pyinstaller EXE OS错误:找不到或加载spatialindex_c-64.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆