r/spacemacs • • Dec 20 '18

Trying to get python layer working

I'm trying to get the python layer to work on spacemacs. I have activated the python and autocompletion layers. I have also tried adding several settings including setting the backend to anaconda and installing jedi, however I cannot get autocomplete nor documentation help (, h h) to work. Could anyone point me in the right direction for this? I have tried the auto-completion layer and python layer documentation but cant seem to figure out what I'm doing wrong..

1 Upvotes

4 comments sorted by

1

u/[deleted] Dec 20 '18

Have you pip installed the python language server?

1

u/NequoFrost Dec 20 '18

I've now got it to work by manually installing all the dependencies for anaconda on both pip and pip3 as I couldnt get pyenv to work. However, I still cant figure out how to use python3 as the interpreter when I run SPC-m-c-c..

1

u/[deleted] Dec 20 '18

1

u/detvardet Dec 20 '18

For develop branch of Spacemacs:

python-language-server is a little buggy these days so I use anaconda now.

In .spacemacs layers:

(auto-completion :variables auto-completion-enable-snippets-in-popup nil auto-completion-enable-help-tooltip t auto-completion-enable-sort-by-usage t)

(python :variables

python-backend 'anaconda

python-fill-column 99

python-enable-yapf-format-on-save t

python-auto-set-local-pyvenv-virtualenv 'on-visit)

Create a new project:

mkdir myproject && cd myproject

pipenv --python 3.7

Install dependencies:

pipenv install autoflake flake8 epc importmagic yapf