Skip to content

Instantly share code, notes, and snippets.

@dokterbob
Last active August 13, 2018 00:47
Show Gist options
  • Select an option

  • Save dokterbob/6410844 to your computer and use it in GitHub Desktop.

Select an option

Save dokterbob/6410844 to your computer and use it in GitHub Desktop.
Setting up a Mac system for Python.
  1. Install XCode and XCode command line tools.

  2. Install SublimeText.

  3. Install SublimeText Package Control.

  4. Install Sublime Linter.

  5. Installing Homebrew:

    ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
    
  6. Follow Homebrew setup instructions.

  7. Install Python with Homebrew:

    brew install python --framework
    
  8. Install common Unix packages using Homebrew:

    brew install screen wget mc bash-completion gnupg graphicsmagick links readline git node tidy-html5
    
  9. Install HTML5-tidy linter (see https://github.com/Homebrew/homebrew-dupes/pull/150):

    brew install --HEAD tidy
    
  10. Some additional changes to ~/.bash_profile:

    # Homebrew over local packages (should only occur once)
    PATH="/usr/local/bin:$PATH"
    
    # --- Make PIP faster
    # Use mirrors when central package repository is down
    PIP_USE_MIRRORS=true
    
    # Use crate.io for the package index export
    PIP_INDEX_URL=https://simple.crate.io/
    
    # Cache previously downloaded packages locally
    PIP_DOWNLOAD_CACHE=~/.pip/download_cache
    
    # Export to make these available in your working environment
    export PIP_USE_MIRRORS PIP_INDEX_URL PIP_DOWNLOAD_CACHE
    
    # --- Homebrew bash completion
    if [ -f $(brew --prefix)/etc/bash_completion ]; then
            . $(brew --prefix)/etc/bash_completion
    fi
    
    # PIP command line completion
    eval "`pip completion --bash`"
    
    # SublimeText 2 as default editor (optional)
    export EDITOR='subl -w'
    
    # Node binaries
    export PATH="/usr/local/share/npm/bin:$PATH"
    
    # Set nice colors for terminal (optional)
    export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
    
  11. Install Python packages:

    pip install virtualenv ipython Pillow pep8 ipdb South Django Fabric Pygments mercurial surlex sorl-thumbnail readline raven nose lxml gunicorn coverage django-extensions beautifulsoup4 six selenium Sphinx PyYAML docutils WebTest
    
  12. Install Node.js packages:

    npm install -g jshint require grunt
    
  13. Install Ruby packages:

    gem update --system
    gem install compass
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment