diff --git a/src/dynare/__init__.py b/src/dynare/__init__.py index ffc4bc82812a2d6313d1183d85b82936c8c6a2d8..327b6f513f03b14a0f97d2e54720b1bcaa2cd78b 100644 --- a/src/dynare/__init__.py +++ b/src/dynare/__init__.py @@ -12,26 +12,14 @@ logger = logging.getLogger("DynarePython") def check_julia_and_dynare(): - try: - # Check if Julia is installed - julia_version = subprocess.check_output( - ["julia", "--version"], stderr=subprocess.STDOUT - ) - logger.info(f"Julia is installed: {julia_version.decode().strip()}") - - # Check if Dynare package is installed in Julia - dynare_check = subprocess.check_output( - ["julia", "-e", 'import Pkg; Pkg.status("Dynare")'], - stderr=subprocess.STDOUT, - ) - if "Dynare" in dynare_check.decode(): - logger.info("Dynare package is installed in Julia.") - else: - logger.info("Dynare package is not installed in Julia.") - except subprocess.CalledProcessError as e: - logger.info(f"An error occurred: {e.output.decode().strip()}") - except FileNotFoundError: - logger.info("Julia is not installed.") + # Check Julia + julia_path = jl.seval("Sys.BINDIR") + julia_project = jl.seval("Base.active_project()") + logger.info(f"Using julia at: {julia_path}") + + # Installed packages + logger.info("Project status:") + jl.seval("import Pkg; Pkg.status()") _has_run = False