0

I am using EIN in Org blocks, as explained on the GitHub page for EIN. So I use ein-python as the language for Org blocks (instead of python).

All seems to work well (for example displaying data from arrays, or displaying images), except when trying to print in the buffer: there is no output in the block results. However, it works with python as the block language.

The following minimal example shows the problem:

#+begin_src python :session localhost :results output
print("Hello")
#+end_src

#+RESULTS:
: Hello

#+NAME: ca60b6cf-8304-4c47-b458-559dea7d9ab0
#+begin_src ein-python :session localhost :results output
print("Hello")
#+end_src

#+RESULTS: ca60b6cf-8304-4c47-b458-559dea7d9ab0

Above, Hello is not displayed the block results in the case of ein-python.

What causes this problem?

Giuseppe
  • 455
  • 2
  • 14
  • See [this question](https://emacs.stackexchange.com/questions/58239/ein-org-mode-results-raw-drawer/58256?noredirect=1#comment90895_58256) where somebody else has similar problems. – NickD May 07 '20 at 14:52
  • @NickD I had seen this post; I am not using Anaconda, but working with a virtual environment, and my variable `org-babel-python-command` is set to `python` (which is python 3.6.9 in my environment). Changing it to for example `python3` does not solve the problem. – Giuseppe May 07 '20 at 15:15
  • Then it may be a problem with Jupyter (or more likely with ob-ein). You might want to submit an issue at the EIN github site. – NickD May 07 '20 at 15:24
  • @NickD Could it be that I need to install `ob-ein` from the GitHub package? On the EIN GitHub page (see link in my question), they do not require to have this package: they only require to specify `ein` in the Org Babel languages... I installed EIN via MELPA and I am not sure whether I have everything needed... – Giuseppe May 08 '20 at 08:46
  • I don't know: I don't use EIN - hence my suggestion to submit an issue at the github site. – NickD May 08 '20 at 13:25
  • @NickD Just for my information, do you know of other means to plot graphs inline in Org than using EIN? Is it possible to have the same functionalities as in a notebook by using only the `python` babel language? – Giuseppe May 08 '20 at 16:41
  • Sorry, I can't comment: I know next to nothing about notebooks. Of course, notebooks are built on python, so in some sense the answer is "yes", but that's not very helpful. – NickD May 08 '20 at 16:50

1 Answers1

0

https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html

#+NAME: BCA82DE1-F7E2-42EF-A37F-84CB9C2AFD0C
#+begin_src ein-python :session http://localhost:8888/frank_ein_inline_image.ipynb :results output 
import sys
print(sys.version)
#+end_src

#+RESULTS: BCA82DE1-F7E2-42EF-A37F-84CB9C2AFD0C
: 3.9.16 (main, Dec  7 2022, 10:15:43) 
: [Clang 14.0.0 (clang-1400.0.29.202)]
Frank Wu
  • 51
  • 2