Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions cadet/cadet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import subprocess
from typing import Optional
import warnings
import sys

from addict import Dict

Expand Down Expand Up @@ -366,9 +367,21 @@ def autodetect_cadet() -> Optional[Path]:
path = shutil.which(executable)

if path is None:
raise FileNotFoundError(
"Could not autodetect CADET installation. Please provide path."
)

dll_paths = [
str(Path(sys.prefix) / 'Library' / 'bin'),
str(Path(sys.prefix) / 'bin'),
]
current_path = os.environ.get('PATH', '')
new_path = os.pathsep.join(dll_paths) + os.pathsep + current_path
os.environ['PATH'] = new_path

path = shutil.which(executable)

if path is None:
raise FileNotFoundError(
"Could not autodetect CADET installation. Please provide path."
)

cli_path = Path(path)
cadet_root = cli_path.parent.parent if cli_path else None
Expand Down
Loading