Austin Fox's personal website.

Fresh MacOS Sierra and SSD install on 2012 MacBook Pro + environment setup

|

My 13” Mid 2012 MacBook Pro was getting slow so after some research it seemed like the best most was to install a SSD and start with a clean install of MacOS Sierra. So far I am quite happy with this decision. Here is how I did it:

Preparation, SSD install, and MacOS install

  1. Save all the things (back everything up)
    • Since we will be wiping the drive and doing a fresh OS install anything not stored somewhere else will be lost
    • For me this was easy as most everything I need is already on Google Drive
  2. Create bootable Flash drive - I will let others tell you how to do this:
  3. Swap in the new SSD - this is fairly straight forward in the 13” MacBook Pro but google can help if you need
  4. Boot from Flash Drive
  5. Partition the new drive as HSF
  6. Install MacOS Sierra

Yes this is really only 6 steps. I hope the intricacies are self explanatory.

Setting up my environment

This requires a number of choices about how you plan to work and what services you want to use. For example Chrome vs. Firefox, Google drive vs. other Cloud storage, Macports vs. Homebrew vs. Conda (I actually tried to switch to conda but had struggles getting some important to me packages to work. Maybe I’ll try again in the future), vim vs. emacs, etc. For me I primarily need google drive, python, vim, and a few scientific packages. Here is how I install:

  1. Download and install G-Chrome
    • In chrome settings click make default
  2. Download and install G-Docs
    • At end in Options - change the name of Drive sync folder - it by default has a space and spaces are ugly
  3. Make or Copy .bash_profile and .vimrc into the Root directory
    • I will be adding post about my 2 files and will update this with links when I do
  4. Install Command Line tools: xcode-select --install
    • Click install
  5. Accept xcode license: sudo xcodebuild -license accept
  6. Make unknown devs allowed: sudo spctl --master-disable
  7. Install Xquarts
  8. Install Macports - Follow directions here
  9. For installing Macports packages I created a script to make my life easier. It may not be the best method but it makes it easy and only shows full output when an install errors:
    • My script and list of packages is on Github

A few notes about using Macports

  1. Macports python packages are stored here:

    /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

  2. DO NOT SUDO NON MACports INSTALLS → Note on why to use “–users” (How to install with python - i.e packages not in MacPorts)

    pip install ~/[Directory containing setup.py] --user which also allows you to have an uninstall command making it slightly better than: python setup.py install package --user

    • This places packages in ~/Library/Python/2.7/lib/python/site-packages where they will automatically be picked up by the Python installation, without messing up the MacPorts file structure
    • Installing with sudo python setup.py install, the packages will be installed inside the MacPorts tree, but MacPorts won’t be aware of it.
    • Don’t ever install anything into /opt/local/ other than via the port command (If you do delete the files)
    • If need to reinstall with pip use -I for ignore current install

Some other useful programs for Materials Science

  1. Install and set up Zotero
  2. Atomic Simulation Environment

Comments