Skip to content

Instantly share code, notes, and snippets.

@rbartelme
Last active January 30, 2024 20:02
Show Gist options
  • Save rbartelme/328bdad9fc049cd9ceb0766974c560cd to your computer and use it in GitHub Desktop.
Save rbartelme/328bdad9fc049cd9ceb0766974c560cd to your computer and use it in GitHub Desktop.
Setup a MacBook for Data Science
#!/usr/bin/env sh
# clean macOS setup after installing xcode via xcode-select --install
# install homebrew for package management
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# make homebrew versions of packages take precedent over path binaries and create .zshrc
echo 'export PATH="/usr/local/bin:/usr/local/sbin:~bin:$PATH"' > .zshrc
# test correct installation of brew
brew doctor
# update index of packages available through homebrew
brew update
#install CLI tools: ex. gnu awk/sed, DS languages, pipenv, RDBs
brew install htop gsed gawk tmux git r python3 pipenv postgresql mysql mariadb julia mactex \
libsvg curl libxml2 gdal geos boost
# install GUI applications via brew cask and x11
brew install --cask slack visual-studio-code docker miniconda rstudio google-chrome zotero xpra \
zoom spotify cyberduck discord vnc-viewer wget xquartz java
# upgrade pip & python setup tools via pip
pip3 install --upgrade pip
pip3 install --upgrade setuptools
# pip install data science stack depends
pip3 install virtualenvwrapper
pip3 install cython
pip3 install nose
# manage the data science stack with pip, since scipy is incomplete via brew
pip3 install numpy scipy matplotlib ipython jupyter pandas sympy nose
#install sklearn with remaining dependencies
pip3 install -U scikit-learn
#install pytorch
pip3 install torch torchvision
#install tensorflow
pip3 install tensorflow
#install cookiecutter data science project management tool
pip3 install cookiecutter
#install new-py
pip3 install new-py
#install rust language
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# enable autocomplete commands
echo "autoload bashcompinit && bashcompinit" >> .zshrc
@rbartelme
Copy link
Author

To run this, download the shell script ds_macup.sh and then run chmod a+x ds_macup.sh to enable semi-automated install via ./ds_macup.sh. I didn't test as sudo, but sudo ./ds_macup.sh may be able to run without a password.

@rbartelme
Copy link
Author

Added Julia and Rust lang installs

@rbartelme
Copy link
Author

added line to append autoload bashcompinit && bashcompinit to .zshrc. need to close terminal or run source .zshrc to init

@rbartelme
Copy link
Author

rbartelme commented Jul 28, 2021

added wget install to version 9

@rbartelme
Copy link
Author

Added pip3 install for cookiecutter

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