Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no org-babel-execute-function after upgrade #489

Open
sternj opened this issue Aug 16, 2023 · 13 comments
Open

no org-babel-execute-function after upgrade #489

sternj opened this issue Aug 16, 2023 · 13 comments

Comments

@sternj
Copy link

sternj commented Aug 16, 2023

Hi all, I just did a doom upgrade and I've stopped being able to use jupyter-python in org mode. The error that I get is

org-babel-execute-src-block: No org-babel-execute function for jupyter-python! 

The salient block in config.el is

(after! org
        (add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images)
        (org-babel-do-load-languages
         'org-babel-load-languages
         '((emacs-lisp . t)
           (julia . t)
           (python . t)
           (jupyter . t)))

       ;; (org-babel-jupyter-override-src-block "python")
        )

and I have org installed with
(org +roam2 +pretty +jupyter) and Python installed with (python +pyenv +lsp +pyright)

I am getting some errors that may or may not be relevant at initialization:

Loading /Users/sam/.emacs.d/.local/cache/recentf...done
Waiting for git... [2 times]
Undo-Fu-Session can not recover undo data: Invalid read syntax: "#", 3, 160
Error in post-command-hook (org-appear--post-cmd): (wrong-type-argument number-or-marker-p nil)
Error in pre-command-hook (org-appear--pre-cmd): (wrong-type-argument number-or-marker-p nil)

When I describe-variable on org-babel-load-languages, I get

Its value is ((jupyter . t) (jupyter-python . t) (emacs-lisp . t))
Original value was ((emacs-lisp . t))

Any idea what's up?

@sternj
Copy link
Author

sternj commented Aug 16, 2023

Worth noting that I reinstalled Emacs and removed .config/emacs and .config/doom but that didn't help and there still seem to be things cached from my last installation

@dangom
Copy link
Contributor

dangom commented Aug 17, 2023

Org 9.7 broke a lot of things, I would suspect this is not necessarily related to emacs-jupyter. See also org-roam/org-roam#2361

@sternj
Copy link
Author

sternj commented Aug 17, 2023

Ah, thank you! I think it might be a good idea to put up a tracking issue on this repo so the next person looking knows to pin org at the older version for now

@sternj sternj closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2023
@sternj
Copy link
Author

sternj commented Aug 17, 2023

Well, I'm back on 9.6.7 and the problem persists, I'm pinned with (package! org :pin "ca873f7") in packages.el and followed the instructions on the linked issue.org-babel-load-languages is still not updating-- am I updating it in the canonical way at the canonical location?

@sternj sternj reopened this Aug 17, 2023
@dangom
Copy link
Contributor

dangom commented Aug 17, 2023

Not sure, but the point is it's hard to assume this has anything to do with this repository when the issue seems to be related to your config and doom. Nothing changed in this repo that broke things that were previously working. In other words, you'd probably get better help opening an issue at the doom repo instead.

@TurbulenceChaos
Copy link

TurbulenceChaos commented Aug 18, 2023

Well, I'm back on 9.6.7 and the problem persists, I'm pinned with (package! org :pin "ca873f7") in packages.el and followed the instructions on the linked issue.org-babel-load-languages is still not updating-- am I updating it in the canonical way at the canonical location?

I pinned jupyter package with (package! jupyter :pin "16cbda79167b4e2f2c6b61b218658f0f660d97f9") in packages.el file and it works well in org mode 9.7. BTW, can you use jupyter widgets in org mode?

@sternj
Copy link
Author

sternj commented Aug 18, 2023

Confirmed that this is a working fix-- perhaps it is something in this repo, then. As for widgets, I must confess to not knowing what they are-- I just use Jupyter for making graphs in all honesty.

@zhenwu0728
Copy link

Having the same issue.
Below is the error message.

~/.config/emacs/.local/straight/build-29.1/jupyter/jupyter-org-extensions.el:
    Warning: ‘buffer-substring’ is an obsolete generalized variable.

Also, reopening the org file solves the issue.

@nnicandro
Copy link
Collaborator

This may be due to 2f14f2e which causes the definition of the Jupyter based execute functions to be delayed until an Org file is opened. If your call to org-babel-do-load-languages happens after you have already opened your Org file, the execute functions may not be defined.

Does evaluating M-: (org-babel-jupyter-aliases-from-kernelspecs) resolve the issue or reopening the file?

@fakeGenuis
Copy link

Run following and reopening .org file seems work

(advice-remove 'org-babel-do-load-languages #'ignore)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (julia . t)
   (python . t)
   (jupyter . t)))

@aelsayd
Copy link

aelsayd commented Oct 24, 2023

(org-babel-jupyter-aliases-from-kernelspecs)

I have reproduced the problem on doom emacs and can confirm that this does indeed fix it . Is there a better workaround?

@ed9w2in6
Copy link

ed9w2in6 commented Nov 6, 2023

maybe related to this? #478

@dlukes
Copy link

dlukes commented Dec 31, 2023

Is there a better workaround?

See this comment for how to set it up so you don't have to run it manually each time, if that qualifies as better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants