Setting Environment (MacOS)

1 minute read

1. Homebrew

R

  • brew upgrade xxx

2. Manual Install

XCode

  • From AppStore

RStudio

  • From website

Python

  • $ brew install pyenv

Update bash_profile:

vi ~/.bash_profile

In bash_profile,

export PYENV_ROOT="/usr/local/var/pyenv"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

Do not forget to source ~/.bash_profile after editing!!

Then, you can install python:

  • $ pyenv install 3.5.2
  • If error occures, try xcode-select --install and install again
  • $ brew install pyenv-virtualenv
  • Usage of pyenv-virtualenv
    • It’s easier to use virtualenv than pyenv to use multiuple versions of Python
    • Make a new environment: $ pyenv virtualenv 3.5.2 NAME
    • Activate the environment: $ pyenv activate NAME or source activate NAME
    • Deactivate the environment: $ pyenv deactivate
    • Delete the environment: $ pyenv uninstall NAME
    • List Current Environments: $ pyenv versions

3. Tex

Reference

Install Ghostscript

brew install ghostscript

Download MacTex

https://tug.org/mactex/mactex-download.html

Install

Do not forget to select custom install and clear the checkbox for Ghostscript

Update TexLive

sudo tlmgr update --self --all
If there is an error, relaunch Terminal.

Set Japanse Fonts

Enter the following commands line by line.

cd /usr/local/texlive/2016/texmf-dist/scripts/cjk-gs-integrate
sudo perl cjk-gs-integrate.pl --link-texmf --force
sudo mktexlsr
sudo kanji-config-updmap-sys hiragino-elcapitan-pron

4. Set TexShop

  1. Update Software
  2. TexShop » Preferences » Source » Set Default Values » pTeX (ptex2pdf)

Update

sudo tlmgr update --self --all

5. pip

pip install jupyter pandas matplotlib beautifulsoup4

6. R Packages

RStan

  • install.packages('rstan', dependencies=T)

7. Chrome Extension

Change Tab Size

Updated: