Skip to content

Instantly share code, notes, and snippets.

@mnencia
Created October 26, 2017 12:30
Show Gist options
  • Select an option

  • Save mnencia/7ac6e6e2487a54ecd1aaba876c925b41 to your computer and use it in GitHub Desktop.

Select an option

Save mnencia/7ac6e6e2487a54ecd1aaba876c925b41 to your computer and use it in GitHub Desktop.
Wrapper to use pyenv with homebrew and gnu binaries
#!/bin/sh
# Add updated software from homebrew
export CFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
for pkg in openssl readline gdbm; do
export CFLAGS="-I$(brew --prefix $pgk)/include $CFLAGS"
export LDFLAGS="-L$(brew --prefix $pkg)/lib $LDFLAGS"
done
export PYTHON_CONFIGURE_OPTS="--enable-framework"
# Remove gnu binaries from path
export PATH=$(echo $PATH | sed 's/:/\n/g' | grep -v gnubin | paste -sd ":" -)
pyenv install "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment