Skip to content
Rupert Bedford edited this page Oct 16, 2018 · 12 revisions
  1. Install Atom and the ide-python package:

    brew cask install atom
    apm install atom-ide-ui
    apm install ide-python 
  2. Create a Python virtualenv and install pyls-black along with its dependencies:

    # Create a directory to keep your virtualenvs in
    mkdir -p ~/.virtualenvs
    
    # Create a new virtualenv
    python3 -m venv ~/.virtualenvs/ide-python
    
    # Install pyls-black in the newly created virtualenv
    ~/.virtualenvs/ide-python/bin/python3 -m pip install pyls-black

    Note: this will create a virtualenv in ~/.virtualenvs/ide-python but the exact location is up to you!

  3. Set the Python path in the ide-python:

    Atom → Preferences → Packages → ide-python → Under Settings → Python Executable

    It should be set to the full path to the Python executable created in the previous step: /Users/rupert/.virtualenvs/ide-python/bin/python3 (replace /Users/rupert with the path to your home folder - ~ is not expanded).

    An alternative is to update your Atom config file directly:

    # config.cson
    
    "*":
      "ide-python":
        python: "/Users/rupert/.virtualenvs/ide-python/bin/python3"

Format on Save

Atom → Preferences → Packages → atom-ide-ui → Under Code Formatting → Format on Save

Alternatively you can update your Atom config file directly:

# config.cson

"*":
  "atom-ide-ui":
    "atom-ide-code-format":
      formatOnSave: true
Clone this wiki locally