-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_path.py
31 lines (26 loc) · 1.25 KB
/
load_path.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os, sys
from termcolor import cprint
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
try:
# prioritize local pddlstream first
# add your PDDLStream path here: https://github.com/caelan/pddlstream
sys.path.append(os.environ['PDDLSTREAM_PATH'])
except KeyError:
cprint('No `PDDLSTREAM_PATH` found in the env variables, using pddlstream submodule', 'yellow')
pddlstream_local_path = os.path.abspath(os.path.join(CUR_PATH, '..', '..', 'external', 'pddlstream'))
assert os.path.exists(pddlstream_local_path)
sys.path.extend([
pddlstream_local_path
])
try:
sys.path.append(os.environ['PYPLANNERS_PATH'])
except KeyError:
cprint('No `PYPLANNERS_PATH` found in the env variables, using pyplanner submodule', 'yellow')
local_pyplanner_path = os.path.abspath(os.path.join(CUR_PATH, '..', '..', 'external', 'pyplanners'))
assert os.path.exists(local_pyplanner_path)
# Inside PDDLStream, it will look for 'PYPLANNERS_PATH'
os.environ['PYPLANNERS_PATH'] = local_pyplanner_path
import pddlstream
cprint("Using pddlstream from {}".format(os.path.dirname(pddlstream.__file__)), 'yellow')
import strips # pyplanners
cprint("Using strips (pyplanners) from {}".format(os.path.dirname(strips.__file__)), 'yellow')