Search code examples
python-3.xmacospyenv

pyenv install 3.8.0b4 on macOS Mojave


I am trying to install the latest beta version of the new Python 3.8. My laptop is running macOS Mojave. I am following the tutorial on RealPython: https://realpython.com/intro-to-pyenv/

and have skimmed through similar questions, e.g. pyenv 3.6.5 BUILD FAILED macOS Mojave 10.14.5

First I run the commands:

brew install openssl readline sqlite3 xz zlib
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
$ exec "$SHELL"
pyenv install --list | grep " 3\.[8]"

Which run successfully and shows that Python 3.8.0b4 is the latest release, which I wish to install;

When attempting to install with:

pyenv install 3.8.0b4

The result reads:

-bash: pyenv: command not found

pyenv is installed however. Any idea about why the command isn't found?

(See the BASH terminal below).

enter image description here


Solution

  • Following PyEnv BUILD FAILED installing Python on MacOS

    The below command successfully installed Python 3.8.0b4:

    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk MACOSX_DEPLOYMENT_TARGET=10.14 pyenv install 3.8.0b4
    

    See output below:

    enter image description here