Closed CestDiego closed 7 years ago
:eyes:
@CestDiego The error is coming from ob-R.el
, which is not needed for python.
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)))
(or even easier, just (require 'ob-python)
) should be enough to get python code blocks working.
As for the actual bug encountered, it looks similar to a known problem in org-mode. See https://www.mail-archive.com/emacs-orgmode@gnu.org/msg98888.html and https://www.mail-archive.com/emacs-orgmode@gnu.org/msg98762.html. Make sure your packages are up to date. If packages are up to date reinstalling org-plus-contrib
might fix it. FWIW, I have org-babel configured in .spacemacs
by adding
(eval-after-load 'org
(lambda()
(require 'ess-site)
(require 'ob-R)
(require 'ob-emacs-lisp)
(require 'ob-latex)
(require 'octave)
(require 'ob-python)
(require 'ob-sql)
(require 'ob-shell)
(require 'ob-sqlite)
(require 'ob-julia)
(require 'ob-perl)
(require 'ob-org)
(require 'ob-awk)
(require 'ob-sed)
(require 'ob-css)
(require 'ob-js)
(require 'ob-stata)
(setq org-export-babel-evaluate nil)
(setq org-startup-indented t)
;; increase imenu depth to include third level headings
(setq org-imenu-depth 3)
;; Set sensible mode for editing dot files
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
;; Update images from babel code blocks automatically
(add-hook 'org-babel-after-execute-hook 'org-display-inline-images)
(setq org-src-fontify-natively t)
(setq org-src-tab-acts-natively t)
(setq org-confirm-babel-evaluate nil)))
to the dotspacemacs/user-init
section. (You may or may not want all my setting of course). This works correctly for me on both the master and develop branches.
@CestDiego
Open ob-R.el and do byte-compile-file
to recompile the ob-R.el and the problems is gone.
@zilongshanren this didn't fix it :(
Try my workaround at the end of #3314.
I did this now:
added (org-babel :location local)
and
(defun org-cestdiego/init-org-babel ()
(use-package org-babel
:init
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)
(emacs-lisp . t)
(python . t)
(sh . t)
(haskell . t)
(js . t)
(latex . t)
(gnuplot . t)
(C . t)
(sql . t)
(ditaa . t)
))
))
To my private layer, and now it works, thank you @liangwang for the solving of the error.
per @zilongshanren 👍
cd ~/.emacs.d/elpa/org-20160926 ; rm ob-R.elc
caveats:
change the date in the folder name.
I have this problem as well, on OSX and Archlinux, emacs 24 and 25, and it is due to ob-R.elc
.
The solutions given by @zilongshanren and @paynito both worked for me.
Calling
spacemacs/recompile-elpa
also works to fix the problem.
Closing in favor of https://github.com/syl20bnr/spacemacs/issues/4618
When trying to eval a python source block I get that I have not defined a babel execute for python, but then I go to my config and I try to execute this:
and I get this backtrace: