1

(Emacs version 26.1, Org version 9.1.9)

I have tried numerous solutions to get working in org-mode source blocks. This solution works to change python-mode to utilize the Python3 interpreter, which I have installed in the local directory. I believe the only relevant part of my config.org file is as follows:

  (setq exec-path (append exec-path '("c:/users/chenry/appdata/local/continuum/anaconda3")))
  (setq python-shell-interpreter "c:/users/chenry/appdata/local/continuum/anaconda3/python.exe")

; more settings...

(with-eval-after-load 'org
    (org-babel-do-load-languages 
     'org-babel-load-languages 
     '(; other babel languages
       (emacs-lisp . t)
       (org . t)
       (shell . t)
       (sql . t)
       (C . t)
       (plantuml . t)
       (R . t)           
       (python . t))))

This works in python-mode, but not in org-mode python source blocks. I've also tried this solution, but I receive the Org-Babel Error Output:

'python3' is not recognized as an internal or external command, operable program or batch file.

For example:

enter image description here

Any advice for how I can make python-mode and org-mode Python interpreters consistent? Thanks!

1
  • 1
    @manandearth Works! Thank you! Added this to my init: (setq org-babel-python-command "c:/users/chenry/appdata/local/continuum/anaconda3/python.exe") If you move this to an answer, I'm happy to accept.
    – ch-pub
    Commented Jul 12, 2018 at 19:35

1 Answer 1

3

Try the full path to python3 inside the double quotes "foo/bar/baz/python3"

Your Answer

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

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