From 22ea8f17c2e57acb32d5b2b7fc4c537ddc00db9f Mon Sep 17 00:00:00 2001 From: eFini Date: Wed, 17 Nov 2021 18:23:05 +0800 Subject: [PATCH] macOS: Fix missing pip command issue. (#22924) * Fixed missing pip command issue. * add path to openpilot_env.sh for mac old-commit-hash: a87190342bbe30aa4fd09c1f9586d9a7060e8b76 --- tools/mac_setup.sh | 1 + tools/openpilot_env.sh | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/mac_setup.sh b/tools/mac_setup.sh index a633066f29..1072c1caaf 100755 --- a/tools/mac_setup.sh +++ b/tools/mac_setup.sh @@ -61,6 +61,7 @@ fi # install python PYENV_PYTHON_VERSION=$(cat $OP_ROOT/.python-version) +PATH=$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH pyenv install -s ${PYENV_PYTHON_VERSION} pyenv rehash eval "$(pyenv init -)" diff --git a/tools/openpilot_env.sh b/tools/openpilot_env.sh index ac784d41e2..81ae00d64d 100755 --- a/tools/openpilot_env.sh +++ b/tools/openpilot_env.sh @@ -1,16 +1,16 @@ if [ -z "$OPENPILOT_ENV" ]; then export PYTHONPATH="$HOME/openpilot:$PYTHONPATH" + export PATH="$HOME/.pyenv/bin:$PATH" + + # Pyenv suggests we place the below two lines in .profile before we source + # .bashrc, but there is no simple way to guarantee we do this correctly + # programmatically across heterogeneous systems. For end-user convenience, + # we add the lines here as a workaround. + # https://github.com/pyenv/pyenv/issues/1906 + export PYENV_ROOT="$HOME/.pyenv" unamestr=`uname` if [[ "$unamestr" == 'Linux' ]]; then - export PATH="$HOME/.pyenv/bin:$PATH" - - # Pyenv suggests we place the below two lines in .profile before we source - # .bashrc, but there is no simple way to guarantee we do this correctly - # programmatically across heterogeneous systems. For end-user convenience, - # we add the lines here as a workaround. - # https://github.com/pyenv/pyenv/issues/1906 - export PYENV_ROOT="$HOME/.pyenv" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)"