pyinstaller EXE OSError : could not find or load spatialindex_c-64. dll

标签 pyinstaller executable libspatialindex

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

我尝试了下面分享的解决方案,但仍然无法解决问题。

  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 正常工作吗?

最佳答案

我遇到了同样的问题,我使用 http://pyinstaller.47505.x6.nabble.com/OSError-while-running-exe-td2997.html 上的最终答案解决了它.

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

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

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

关于pyinstaller EXE OSError : could not find or load spatialindex_c-64. dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64398516/

相关文章:

r-tree - 如何在 Google Colaboratory 上安装 libspatialindex

c++ - 作为对象传递给 MyDataStream 流(argv [1])的输入数据文件的格式应该是什么

c++ - 使用空间索引库批量加载 R* 树

python - Pyinstaller - 在 dist 中包含空文件夹

runtime-error - .PYZ 文件扩展名

java - 如何重命名java进程?

java - 使用MyEclipse GUI将图片放入java程序中

python - 在 anaconda 环境中使用 pyinstaller

python - 当我使用 PyInstaller 时,为什么我的库会出现 platformdirs.mac 错误?

android - 在 Android 操作系统上运行 Haskell 程序