Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure spacemacs for python 3?

I would like to use spacemacs for python development, but I see a syntax error on Python 3 constructs, like print(*(i + 1 for i in range(n)) or async def foo():. Adding a shebang to my file (#!/usr/bin/python3 or #!/usr/bin/env python3) does not help.

What configuration changes do I need to make to use a specific python version? Ideally per-project or per-file, but global is better than nothing. I have 2.7 and 3.4 installed system-wide, and 3.5 in ~/local (~/local/bin is in my $PATH).

like image 898
kai Avatar asked Dec 07 '15 14:12

kai


Video Answer


1 Answers

The variable that needed to be set was flycheck-python-pycompile-executable, to "python3".

To get support for async, emacs25 must be used (note debian will install emacs24 and emacs25 side-by-side, and use emacs24 by default).

like image 77
kai Avatar answered Oct 12 '22 13:10

kai