Skip to content

Commit 5df6eba

Browse files
committed
Tring yet another way to collect cadadi libs
1 parent 721e383 commit 5df6eba

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

pyinstaller.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ a = Analysis(
3333
runtime_hooks=[
3434
'pyinstaller/pyi_rth_fontconfig.py',
3535
'pyinstaller/pyi_rth_qt_xcb.py',
36+
'pyinstaller/pyi_rth_casadi.py',
3637
],
3738
excludes=['_tkinter', 'spyder'],
3839
win_no_prefer_redirects=False,

pyinstaller/pyi_rth_casadi.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import os
2+
import sys
3+
4+
# Python 3.8+ uses a restricted DLL search path on Windows. PyInstaller adds
5+
# _MEIPASS to the search path but not subdirectories. casadi's companion DLLs
6+
# live in _MEIPASS/casadi/, so register that directory explicitly.
7+
if sys.platform == 'win32':
8+
casadi_dir = os.path.join(sys._MEIPASS, 'casadi')
9+
if os.path.isdir(casadi_dir):
10+
os.add_dll_directory(casadi_dir)

0 commit comments

Comments
 (0)