From fed7cfeef064b12f76b413298ffdf71fec1f537e Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 31 Dec 2021 20:34:08 -0700 Subject: [PATCH] PC: dynamically set PYTHONPATH from real openpilot path (#23322) * dynamic PYTHONPATH setting based on actual openpilot location * right above * fix path * absolute path all the time * Revert "absolute path all the time" This reverts commit c0bc2e08e76bd6c0abd36fa082ee00b4746e62dc. * Update tools/openpilot_env.sh Co-authored-by: Willem Melching Co-authored-by: Willem Melching --- tools/openpilot_env.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/openpilot_env.sh b/tools/openpilot_env.sh index 81ae00d64d..3412c32d68 100755 --- a/tools/openpilot_env.sh +++ b/tools/openpilot_env.sh @@ -1,5 +1,6 @@ if [ -z "$OPENPILOT_ENV" ]; then - export PYTHONPATH="$HOME/openpilot:$PYTHONPATH" + OP_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" + export PYTHONPATH="$OP_ROOT:$PYTHONPATH" export PATH="$HOME/.pyenv/bin:$PATH" # Pyenv suggests we place the below two lines in .profile before we source