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 -)"