Skip to content

Commit

Permalink
use os.add_dll_directory for windows when using the **installed** Pyt…
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Nov 6, 2024
1 parent c3edbd2 commit 6eb299b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/module/openstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
from .openstudioutilitiesxml import *

else:
import os
if os.name == 'nt':
# When we're using system python to load the **installed** C:\openstudio-X.Y-Z\Python stuff (not PyPi package)
# This allows finding openstudiolib.dll and the msvc ones in the bin/ folder while we're in the Python/ folder
# Otherwise you'd have to manually copy these DLLs from bin/ to Python/
os.add_dll_directory(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'bin')))
import openstudioairflow as airflow
import openstudioenergyplus as energyplus
import openstudioepjson as epjson
Expand Down

0 comments on commit 6eb299b

Please sign in to comment.