diff --git a/pysrc/juliacall/__init__.py b/pysrc/juliacall/__init__.py index ad8627b0..f6396a72 100644 --- a/pysrc/juliacall/__init__.py +++ b/pysrc/juliacall/__init__.py @@ -50,6 +50,14 @@ def backtrace(self): def init(): import os + if os.environ.get("CONDA_PREFIX", "") != "": #Only when calling from PythonCall + ## For Windows and Python 3.8+ we need to add dll search paths + import sys + import platform + if platform.system() == "Windows" and sys.version_info >= (3, 8): + dll_search_path = os.path.join(os.environ["CONDA_PREFIX"], "Library", "bin") + if os.path.exists(dll_search_path): + os.add_dll_directory(dll_search_path) import ctypes as c import sys import subprocess