I know i can set an interpreter with the code below, is there a way i can set this per project so that when I open emacs with a specific project it selects the interpreter for that project.

(setq python-shell-interpreter "/docker:root@django_web_1:/usr/local/bin/python")

currently i am doing this manually and want a better way as each project runs in its own containers and I often switch projects.

1 Answer 1


You can set it as a directory-local variable. This is documented in section 51.2.5 Per-Directory Local Variables of the Emacs manual. You can use C-h i to open the manual, or view it online at https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html.

  • This sounds like exactly what i am after cheers.
    – Oly
    Jan 3, 2018 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.