diff --git a/kokoro/macos/prepare_build_macos_rc b/kokoro/macos/prepare_build_macos_rc index 7a150c79fb..d9677e966b 100755 --- a/kokoro/macos/prepare_build_macos_rc +++ b/kokoro/macos/prepare_build_macos_rc @@ -26,7 +26,6 @@ export CXX=g++ ## # Install Python 2 by default - eval "$(pyenv init -)" pyenv install -v -s 2.7.18 && pyenv global 2.7.18 @@ -34,6 +33,9 @@ pyenv install -v -s 2.7.18 && pyenv global 2.7.18 # Install Tox if [[ "${KOKORO_INSTALL_TOX:-}" == "yes" ]] ; then + # pyenv needs to be directed towards its dependencies. + CFLAGS="-I$(brew --prefix zlib)/include" \ + LDFLAGS="-L$(brew --prefix zlib)/lib" \ pyenv install -v -s 3.7.13 pyenv global 3.7.13 sudo python -m pip install --upgrade pip 'tox==3.27.1' tox-pyenv