Install pyenv exited with 128 and 1

Hi, I am trying to install pyenv on macOS 10.14.6. I’m getting a ‘failure while executing, exited with with 128’ and ‘exited with 1’ error and pyenv is not installing. Do you have any recommendations?

$ brew install pyenv

Updating Homebrew…
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
remote: Enumerating objects: 124, done.
remote: Counting objects: 100% (124/124), done.
remote: Compressing objects: 100% (84/84), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core exited with 128.
Error: Failure while executing; /usr/local/bin/brew tap homebrew/core exited with 1.
==> Tapping homebrew/core
Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core’…
remote: Enumerating objects: 124, done.
remote: Counting objects: 100% (124/124), done.
remote: Compressing objects: 100% (84/84), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Error: Failure while executing; git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core exited with 128.
Error: Failure while executing; /usr/local/bin/brew tap homebrew/core exited with 1.

Your connection doesn’t let brew download the required files to install pyenv. What does brew doctor, brew tap and brew config say?

Running brew update fixed this issue for me