Skip to content

Instantly share code, notes, and snippets.

@AtalayBarut
Last active January 15, 2022 14:37
Show Gist options
  • Select an option

  • Save AtalayBarut/7ac71d6a0423225226c30b72f72709d3 to your computer and use it in GitHub Desktop.

Select an option

Save AtalayBarut/7ac71d6a0423225226c30b72f72709d3 to your computer and use it in GitHub Desktop.

Install and Configure Python for M1 Mac

# Check Python versions
~ type -a python
python is /usr/bin/python

~ which python
/usr/bin/python

~ python --version
Python 2.7.16
# Update Homebrew and Install pyenv (Assumption is that you've already Homebrew installed in your OS)
~ brew update
~ brew install pyenv

# Open your .zshrc (or .bashrc) file with a code editor e.g. nano
~ nano ~/.zshrc

# Add below comment to your zsh profile in order to set pyenv version as your global python version
~ eval "$(pyenv init --path)"

https://stackoverflow.com/questions/33321312/cannot-switch-python-with-pyenv

Pyenv

# List all installable versions and choose one
~ pyenv install --list
~ pyenv install 3.8.12

# List all available versions in your system
~ pyenv versions

# See global python version
~ pyenv global

# Set your global python version
~ pyenv global 3.8.12

# Check global python version
~ python --version

# To uninstall a specific python version
~ pyenv uninstall 3.8.12

# pyenv install path
~/.pyenv/versions

https://github.com/pyenv/pyenv

https://laict.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment