Spacemacs setup for python development
Using Spacemacs as Python3 backend development IDE, I needed to make following changes.
- install python3-venv and pudb for go-to-definition to work properly
- python3 language needs flycheck-python-pycompile-executable to be set to “python3”
- env PYTHONPATH may also be set properly.
to have go-to-definition working properly, the project needs a venv and activation in emacs.
cd your_project_dir
python3 -m venv env
... in emacs:
spc m V a then select ./env/
.spacemacs file:
dotspacemacs-configuration-layers
'(
git
markdown
syntax-checking
version-control
python
..
;; updated the search tools order to ack first.
dotspacemacs-search-tools '("ack" "ag" "pt" "grep")
(defun dotspacemacs/user-config ()
(setq flycheck-python-pycompile-executable "python3")
This should fix issues including:
- spc m g g , or g d
- autocomplete
debugging
I found debugging is still not as good as PyCharm. I use Pudb for debugging.
You can find my .spacemacs file here