Skip to content

Instantly share code, notes, and snippets.

@nficano
Created June 10, 2020 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nficano/12f299317981c1f7b2e11593678c5065 to your computer and use it in GitHub Desktop.
Save nficano/12f299317981c1f7b2e11593678c5065 to your computer and use it in GitHub Desktop.
python fix
# Install MacOS Xcode Command Line Tools (even if you've done it, run to make sure you're up-to-date)
xcode-select --install
# let's get rid of any existing python install
brew uninstall python --ignore-dependencies > /dev/null 2>&1
brew uninstall python2 --ignore-dependencies > /dev/null 2>&1
brew uninstall python3 --ignore-dependencies > /dev/null 2>&1
# just back-up your virtualenvs to be safe
mkdir $HOME/.virtualenvs
brew install python
# this is important
brew install openssl
brew unlink python
brew link --override --force python
brew link --overwrite --force openssl
# OK we need to make sure openssl sits high on your system path:
# if you use zsh:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/python/libexec/bin:$PATH"' >> ~/.zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
brew install pyenv
# reload your shell, restart terminal/iterm2, or just open a new tab.
pyenv install 3.7.7
pyenv global 3.7.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment