OSError while running exe

186 views
Skip to first unread message

Tim Nazarov

unread,
Aug 5, 2020, 11:22:21 AM8/5/20
to PyInstaller
I am trying to generate .exe with the help of pyinstaller. However, when I try to run my executable file it generates an error :

in exec_module exec(bytecode,module.__dict__) 
File "rtree\core.py",line 126, in <module> 
OSError: could not find or load spatialindex_c-64.dll 
[16436] Failed to execute script main

I have seen few questions related to this problem but nothing helps. I tried to uninstall rtree and download a .whl file but after installation error was similiar but spatialindex_c-64.dll was substituted with spatialindex_c.dll

If somebody have any ideas i can send a full code of .py program!

Thank for response!

bwoodsend

unread,
Aug 6, 2020, 12:35:40 PM8/6/20
to PyInstaller

You just need to do what it’s telling you. It’s expecting a dll called spatialindex_c-64.dll which PyInstaller failed to detect - you’ll need to explicitly tell it to include it. No use ripping up your Python installation. Find where it is one your computer, then add the --add-data=C:\path\to\spatialindex_c-64.dl;. (note the trailing ;.) option to your build command.

Heng SiewChean

unread,
Oct 19, 2020, 4:48:54 AM10/19/20
to PyInstaller
I tried the suggestion above but still face the same problem :-(  @tim, did you solved your problem?

Really need help here as i already tried different solution proposed through the web but nothing help.

Heng SiewChean

unread,
Oct 19, 2020, 11:34:36 AM10/19/20
to PyInstaller
I tried the solution by @ bwoodsend  . But i still get the same error. Is there any other solution for this?

@ Tim Nazarov   have your problem solved?

On Friday, August 7, 2020 at 12:35:40 AM UTC+8 bwoodsend wrote:

bwoodsend

unread,
Oct 20, 2020, 4:02:36 PM10/20/20
to PyInstaller

Ah, I see. It’s got two of them and a rather messy way of finding them. For this you have to use the spec file. Find the test.spec (or whatever you called your code) and put

from PyInstaller.utils.hooks import collect_dynamic_libs

at the top. And in the a = Analysis(...) bit change binaries=[], to binaries=binaries=collect_dynamic_libs("rtree"),. Then rebuild from the spec file using PyInstaller test.spec.

Reply all
Reply to author
Forward
0 new messages