Get AI summaries of any video or article — Sign up free
Setting up a Python Development Environment in Atom thumbnail

Setting up a Python Development Environment in Atom

Corey Schafer·
5 min read

Based on Corey Schafer's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Install Atom, then use Atom’s built-in package manager via Preferences to add Python development capabilities.

Briefing

Atom is positioned as a free, GitHub-backed editor that can be turned into a practical Python workspace with a handful of packages—most importantly Script for running code, plus formatting and linting tools to keep projects consistent. The setup starts with installing Atom, then opening a sample Python module to confirm the editor can display code cleanly. Unlike Sublime Text, Atom’s package manager is built in, letting users install functionality directly from the preferences UI rather than relying on extra steps.

After installation, the workflow hinges on adding Script. Once Script is installed, Atom can execute Python files from inside the editor using keyboard shortcuts (on macOS, Command + I; on Linux/Windows, Shift + Ctrl + B). Running the sample script reveals the default Python interpreter path and version on the machine (the transcript shows Python 3.5). From there, the environment can be customized: a theme is installed in Atom’s split model (syntax vs UI), and the transcript uses the “Pardon” theme’s syntax coloring while leaving the default UI. Editor settings are then adjusted for readability and behavior—switching to Source Code Pro, increasing font size, enabling “scroll past end,” and setting tab length to four spaces to match common Python style.

The next layer is controlling code assistance. Atom’s built-in autocomplete features (Autocomplete Plus and Autocomplete Snippet) are disabled to reduce intrusive suggestions. For users who want smarter, Python-aware completions, the transcript demonstrates installing “autocomplete-python,” then choosing between Kite (cloud documentation) and a local engine—important for workplaces that restrict sending code to the internet. After testing, the autocomplete package can be turned back off if it still doesn’t match personal preference.

To improve day-to-day navigation and code quality, several productivity packages are added: File Icons to make the project tree more informative, Minimap to show a scrollable overview for large files, and Python Auto Pep 8 to enforce formatting. Auto Pep 8 requires installing the underlying autopep8 tool via pip, and formatting only takes effect when “format on save” is enabled in Atom settings. For error detection, the transcript installs linter-flake8 (which pulls in a linter dependency) and then installs flake8 via pip. With the linter active, syntax mistakes like a missing colon in a for-loop are flagged inline, and follow-on issues (such as an undefined name) appear until the code is corrected.

Finally, Atom’s Script package supports running different Python versions and virtual environments through configurable run options. The transcript shows creating a saved profile that points to Python 2.7 (using a user/bin/python 27 path), then running the same script under that profile to confirm the interpreter and version change. If no profile is selected, Atom falls back to the default interpreter (shown as Python 3.5). The result is a repeatable setup: run code, format on save, lint in the background, and switch interpreters without leaving the editor.

Cornell Notes

Atom can be configured into a full Python development environment by installing a small set of packages. The Script package enables running Python files inside Atom (Command + I on macOS; Shift + Ctrl + B on Linux/Windows) and supports profiles to select different Python interpreters such as Python 2.7 or a default like Python 3.5. Editor customization includes choosing a syntax theme, setting Source Code Pro, enabling “scroll past end,” and using four-space indentation. Code quality is enforced by Python Auto Pep 8 (autopep8 via pip, with “format on save” enabled) and linter-flake8 (flake8 via pip) to flag syntax and name errors inline. Optional autocomplete can be replaced with autocomplete-python using either Kite or a local engine.

What package makes Atom able to run Python scripts, and how does interpreter selection work?

The Script package adds run capability. After installing it, macOS users run the current script with Command + I (Linux/Windows uses Shift + Ctrl + B). To switch interpreters, open the Command Palette (Command + Shift + P), search for Script, then use Run options to set the command path to a specific Python executable. Saving those settings as a profile lets users run the script with that profile repeatedly (the transcript notes Command + Shift + K for “run with profile” on macOS).

Why does formatting sometimes fail after installing Python Auto Pep 8, and what setting fixes it?

Python Auto Pep 8 depends on the external autopep8 tool installed via pip (the transcript uses pip install Auto Pep 8). Even with the package installed, formatting won’t apply unless Atom is set to format on save. The transcript demonstrates installing the package, saving changes, seeing no auto-formatting, then enabling the “format on save” checkbox in Atom settings; after that, saving triggers reformatting to match PEP 8 spacing.

How does the linter-flake8 setup catch mistakes, and what does it look like in practice?

Installing linter-flake8 adds background linting, but it also requires installing flake8 itself via pip (pip install flake8). When the transcript introduces a syntax error—omitting the colon in a for-loop—Atom marks the problematic line with a syntax error message (e.g., “unexpected indentation”). After fixing that, a second warning appears for an undefined name (printing “in” instead of “num”), and both warnings disappear once the code is corrected.

What’s the difference between Atom’s default autocomplete and a Python-specific alternative?

Atom’s default autocomplete features (Autocomplete Plus and Autocomplete Snippet) can be disabled if they produce distracting suggestions. For Python-aware completions, the transcript installs autocomplete-python. During setup, it asks whether to use Kite (cloud-based documentation) or a local engine; the transcript chooses the local engine due to workplace restrictions on sending code to the cloud. After enabling it, completions become more Python-specific.

Which packages improve navigation and readability beyond Python-specific tooling?

File Icons makes the project tree more informative by showing colored icons (including a distinct Python icon) next to filenames. Minimap adds a right-side overview of the file and the current position, which becomes more valuable in large codebases. Together with theme and editor settings (font, scroll behavior, tab width), they make the editing experience smoother.

How do theme installation choices differ from Sublime Text, according to the transcript?

Atom breaks themes into separate components, particularly UI versus syntax. The transcript installs only the syntax coloring for the “Pardon” theme (rather than the entire theme), while keeping Atom’s default UI. Activation happens under Themes → Syntax theme, after which the code display updates immediately.

Review Questions

  1. If a Python file runs but formatting doesn’t change after saving, which two checks should be made in this Atom setup?
  2. How would you create and use a Script profile to run a project with Python 2.7 instead of the default interpreter?
  3. What sequence of steps installs both flake8 linting and the underlying flake8 tool, and how can you verify the linter is working?

Key Points

  1. 1

    Install Atom, then use Atom’s built-in package manager via Preferences to add Python development capabilities.

  2. 2

    Use the Script package to run Python files inside Atom and create saved profiles to target different Python interpreters.

  3. 3

    Customize editor usability with Source Code Pro, four-space indentation, “scroll past end,” and a syntax theme.

  4. 4

    Disable Autocomplete Plus and Autocomplete Snippet if autocomplete popups feel distracting, or replace them with autocomplete-python for Python-aware suggestions.

  5. 5

    Enforce PEP 8 formatting with Python Auto Pep 8, but also install autopep8 via pip and enable “format on save.”

  6. 6

    Catch errors early by installing linter-flake8 and flake8 via pip; verify by introducing a syntax error and watching inline warnings appear.

Highlights

Script turns Atom into a runnable Python editor, and saved Script profiles let the same file run under Python 2.7 or the default interpreter without leaving the editor.
Python Auto Pep 8 only reformats on save when Atom’s “format on save” setting is enabled—installing the package alone isn’t enough.
linter-flake8 flags both syntax problems (like a missing colon) and follow-on issues (like undefined names) until the code is corrected.

Topics

  • Atom Setup
  • Python Running
  • Code Formatting
  • Linting
  • Autocomplete