Skip to content

Instantly share code, notes, and snippets.

@chm123
Created November 30, 2022 18:44
Show Gist options
  • Select an option

  • Save chm123/6bf5f98675a0055ff577831018b17482 to your computer and use it in GitHub Desktop.

Select an option

Save chm123/6bf5f98675a0055ff577831018b17482 to your computer and use it in GitHub Desktop.
Install Python on M1
brew update && brew install pyenv pyenv-virtualenv
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
brew install zlib sqlite bzip2 libiconv libzip openssl rust
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(brew --prefix zlib)/include -I$(brew --prefix sqlite)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix bzip2)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix sqlite)/lib" pyenv install miniforge3-4.10.3-10
pyenv global miniforge3-4.10.3-10
conda update --force conda -y
conda install -c apple tensorflow-deps==2.10.0 -y
python -m pip install tensorflow-macos==2.10.0
python -m pip install tensorflow-metal==0.6.0
conda install pytorch==1.10.2 -y
# For some reason torchvision needs to be install separately or it will default to a really old version
conda install torchvision==0.11.3 -y
conda install jupyter -y
conda install -c conda-forge jupyterlab -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment