Atom for Python development
I was looking for something like this, not a full-blown
Java-based IDE, but merely a text editor with syntax checking and highlighting. Sublime Text is a great thing too, but for this particular purpose I liked Atom more.
So, that’s what we want to achieve:
As you can see, it not only highlights syntax, but also looks for syntax errors and provides information for whatever founded.
And now how to set all this up. I used this article, and it covers the whole process pretty nicely, but when I was using it to install the same thing at some point later, it didn’t work for me (probably because of the new linter version), so I decided to write my own article with some additions and notes.
Well, install Atom itself. Make sure
apm is available in your
PATH variable: on Mac OS you can launch Atom and execute
Atom -> Install Shell Commands; on Windows it can be found in
Now open the command line and install the following packages:
apm install linter pip install flake8 apm install linter-flake8
This should be enough, and it was, but then after updating linter to the latest version it stopped working - no warnings, no checking for errors. But installing these additional packages solved the problem:
pip install flake8-docstrings pip install hacking
For Mac OS you might also want to add these lines into your
'atom-workspace atom-text-editor': 'ctrl-backspace': 'editor:delete-to-previous-word-boundary' 'ctrl-delete': 'editor:delete-to-next-word-boundary'
One final thing - to run your Python scripts right from Atom, install the Script package:
apm install script
Now the output of running scripts will be shown right there:
After some time, some packages got an update and something broke, so now every time I open any Python file I get this error:
Solution is to update the
pip install flake8-docstrings --upgrade
Now it’s back to normal.
…Or you can use Visual Studio Code, like I did after some time. It just feels faster and a bit more convenient. And also doesn’t have those infinite update cycles on Mac OS.