From 38f195734e139981c5a2b60ab96c8962f4b5b0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Simon?= <tamas.simon@alphacruncher.com> Date: Mon, 2 Dec 2024 13:37:37 +0000 Subject: [PATCH] Log different data --- src/dynare/__init__.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/dynare/__init__.py b/src/dynare/__init__.py index ffc4bc8..327b6f5 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 -- GitLab