ob-ipython icon indicating copy to clipboard operation
ob-ipython copied to clipboard

json-read: JSON readtable error with python 3.6.3

Open lengyueyang opened this issue 7 years ago • 38 comments

We I use python 3.6.2 and 3.6.2, when execute, occur json-read: JSON readtable error, but when use python 3.5.2, all is ok

lengyueyang avatar Oct 31 '17 02:10 lengyueyang

I had this problem and had to downgrade.

Can we have a section in README that mentions the latest version of python this has been tested on?

dcherian avatar Nov 13 '17 18:11 dcherian

Neither downgrading with conda install python=3.5 (resulted in 3.5.4) nor conda install python=3.5.2 worked for me.

andrewsanchez avatar Nov 13 '17 21:11 andrewsanchez

Oh I meant downgrade ob-ipython. I haven't tried with python 3.5

dcherian avatar Nov 13 '17 21:11 dcherian

Can someone who's using the latest ob-ipython please comment with versions of python / ipython / jupyter they're using?

dcherian avatar Nov 17 '17 04:11 dcherian

I think I figured this out, at least on my system (latest version of ob-ipython, ipython version 6.1.0, python version 3.6.2 with Anaconda). I got this error too, and I fixed it by using exec-path-from-shell to set the PATH correctly. Install that from MELPA and put this in your init file before loading ob-ipython:

(when (memq window-system '(mac ns x))
  (exec-path-from-shell-initialize)) 

I think the reason this happens is because it uses jupyter to get a JSON output of the kernels, but it runs that via shell-command, which doesn't use the exec-path variable the rest of Emacs uses. You should be good if M-! jupyter -h returns a normal help entry and not zsh:1:command not found: 'jupyter' or equivalent.

This is probably a documentation problem moreso than a code problem, as I'm not sure how you're supposed to be able to divine where the jupyter executable is in elisp.

nicholas-miklaucic avatar Nov 29 '17 19:11 nicholas-miklaucic

Hmm... I've always had exec-path-from-shell configured and running. M-! jupyter -h returns a normal help entry too.

Is there a way to see the string json-read is having trouble decoding? My elisp isn't good enough to figure it out.

dcherian avatar Dec 03 '17 09:12 dcherian

We must have different errors with the same error message. Can you try invoking toggle-debug-on-errorand then running it, or if that doesn't work trying toggle-debug-on-entry with json-read?

nicholas-miklaucic avatar Dec 03 '17 23:12 nicholas-miklaucic

@nicholas-miklaucic Thanks!

Using debug-on-entry showed this (newlines added for clarity):

  json-read-from-string("/home/deepak/.bashrc: line 115: bind: warning: line editing not enabled\n
{\n 
 \"kernelspecs\": {\n    \"python3\": {\n     
 \"resource_dir\": \"/home/deepak/anaconda3/share/jupyter/kernels/python3\",\n      \"spec\": {\n        \"argv\": [\n         
 \"/home/deepak/anaconda3/bin/python\",\n          \"-m\",\n          \"ipykernel_launcher\",\n          \"-f\",\n          \"{connection_file}\"\n        ],\n        \"env\": {},\n       
 \"display_name\": \"Python 3\",\n        \"language\": \"python\"\n      }\n    }\n  }\n}\n")

Once I comment the line that makes bash throw a warning, things work!

@gregsexton Maybe a regexp to select the bit that begins with {\n and ends with \n") before passing it to json-read would do the trick? Perhaps you could catch the error and display the string so it's clear what json-read is choking on?

dcherian avatar Dec 04 '17 06:12 dcherian

This isn't working at all for me. Using Python 3.6.2 and getting the same JSON read table error. This is me trying to run the example:

Debugger entered--Lisp error: (json-readtable-error)

  signal(json-readtable-error nil)
  json-read()
  (cons (json-read) acc)
  (setq acc (cons (json-read) acc))
  (while (not (= (point) (point-max))) (setq acc (cons (json-read) acc)) (forward-line))
  (let (acc) (while (not (= (point) (point-max))) (setq acc (cons (json-read) acc)) (forward-line)) (nreverse acc))
  (let ((json-array-type (quote list))) (let (acc) (while (not (= (point) (point-max))) (setq acc (cons (json-read) acc)) (forward-line)) (nreverse acc)))
  ob-ipython--collect-json()
  (if (> ret 0) (ob-ipython--dump-error (buffer-string)) (goto-char (point-min)) (ob-ipython--collect-json))
  (let ((ret (apply (quote call-process-region) code nil (ob-ipython--get-python) nil t nil (list "--" ob-ipython-client-path "--conn-file" name "--execute")))) (if (> ret 0) (ob-ipython--dump-error (buffer-string)) (goto-char (point-min)) (ob-ipython--collect-json)))
  (progn (let ((ret (apply (quote call-process-region) code nil (ob-ipython--get-python) nil t nil (list "--" ob-ipython-client-path "--conn-file" name "--execute")))) (if (> ret 0) (ob-ipython--dump-error (buffer-string)) (goto-char (point-min)) (ob-ipython--collect-json))))
  (unwind-protect (progn (let ((ret (apply (quote call-process-region) code nil (ob-ipython--get-python) nil t nil (list "--" ob-ipython-client-path "--conn-file" name "--execute")))) (if (> ret 0) (ob-ipython--dump-error (buffer-string)) (goto-char (point-min)) (ob-ipython--collect-json)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((ret (apply (quote call-process-region) code nil (ob-ipython--get-python) nil t nil (list "--" ob-ipython-client-path "--conn-file" name "--execute")))) (if (> ret 0) (ob-ipython--dump-error (buffer-string)) (goto-char (point-min)) (ob-ipython--collect-json)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((ret (apply ... code nil ... nil t nil ...))) (if (> ret 0) (ob-ipython--dump-error (buffer-string)) (goto-char (point-min)) (ob-ipython--collect-json)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  ob-ipython--execute-request("%matplotlib inline\nimport matplotlib.pyplot as plt\nimport numpy as np" "default")
  (ob-ipython--eval (ob-ipython--execute-request (org-babel-expand-body:generic (encode-coding-string body (quote utf-8)) params (org-babel-variable-assignments:python params)) (ob-ipython--normalize-session session)))
  (let ((ret (ob-ipython--eval (ob-ipython--execute-request (org-babel-expand-body:generic (encode-coding-string body (quote utf-8)) params (org-babel-variable-assignments:python params)) (ob-ipython--normalize-session session))))) (if ret (progn (ob-ipython--process-response ret file result-type))))
  (let* ((file (cdr (assoc :ipyfile params))) (session (cdr (assoc :session params))) (result-type (cdr (assoc :result-type params)))) (ob-ipython--create-kernel (ob-ipython--normalize-session session) (cdr (assoc :kernel params))) (let ((ret (ob-ipython--eval (ob-ipython--execute-request (org-babel-expand-body:generic (encode-coding-string body ...) params (org-babel-variable-assignments:python params)) (ob-ipython--normalize-session session))))) (if ret (progn (ob-ipython--process-response ret file result-type)))))
  ob-ipython--execute-sync("%matplotlib inline\nimport matplotlib.pyplot as plt\nimport numpy as np" ((:colname-names) (:rowname-names) (:result-params "replace" "drawer") (:result-type . value) (:results . "replace drawer") (:exports . "code") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:session)))
  (if (cdr (assoc :async params)) (ob-ipython--execute-async body params) (ob-ipython--execute-sync body params))
  org-babel-execute:ipython("%matplotlib inline\nimport matplotlib.pyplot as plt\nimport numpy as np" ((:colname-names) (:rowname-names) (:result-params "replace" "drawer") (:result-type . value) (:results . "replace drawer") (:exports . "code") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:session)))
  org-babel-execute-src-block(nil ("ipython" "%matplotlib inline\nimport matplotlib.pyplot as plt\nimport numpy as np" ((:colname-names) (:rowname-names) (:result-params "drawer" "replace") (:result-type . value) (:results . "drawer replace") (:exports . "code") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 714 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)

There are also seem to be problems with it killing the jupyter process. I have to kill it manually otherwise I get errors from ZMQ saying the port is already in use.

georgek avatar Dec 04 '17 15:12 georgek

Try invoking toggle-debug-on-entry with json-read to see what it's choking on: your error seems different as it's for running code, AFAIK.

nicholas-miklaucic avatar Dec 04 '17 15:12 nicholas-miklaucic

You'll also want to make sure that jupyter isn't writing any warnings also. I had to remove those too.

dcherian avatar Dec 04 '17 15:12 dcherian

I get a buffer called *ob-ipython-kernel-default* with some output from starting a jupyter console. It seems that json-read is being run on this buffer which doesn't contain anything that looks like JSON:

Jupyter console 5.2.0

Python 3.6.2 (default, Sep 28 2017, 13:58:54) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.0 -- An enhanced Interactive Python. Type '?' for help.



In [1]: 

georgek avatar Dec 05 '17 08:12 georgek

@georgek That's how it looks like when it works.

Set debug-on-entry to stop at ob-ipython--collect-json. When it does hit c to continue, do this twice and it should show the string it's trying to read. That'll tell you what it's choking on

EDIT: Not sure that will work actually but you can try. I found the second answer here helpful: https://stackoverflow.com/questions/3257480/how-to-debug-elisp#3258205

dcherian avatar Dec 05 '17 09:12 dcherian

I've tried using edebug and stepping through. The difficulty seems to be that in ob-ipython--execute-request it runs ob-ipython--collect-json in a temporary buffer. I can't figure out how to look at what's being written in the temp buffer, though.

georgek avatar Dec 05 '17 09:12 georgek

OK, I finally figured it out. It's not easy to debug something that uses with-temp-buffer, but eventually I figured out I could manually repalce that with a real buffer and see the output. Turns out my ipython prints an error about being run in a virtualenv which is not proper JSON. So now I need to figure out how to suppress that warning (which I think is safe).

I succumbed to installing jupyter/ipython within each virtualenv and now there is no error and it works.

georgek avatar Dec 05 '17 11:12 georgek

Any news about this bug?

nanounanue avatar Dec 15 '17 02:12 nanounanue

Hi everybody, I have the same issue with python 2.7.12. @georgek : how to tell emacs to use a particular virtualenv installation of jupyter/python ? I am a bit confused at this point.

ludicludo avatar Dec 18 '17 23:12 ludicludo

@ludicludo you can use pyenv-mode for specify the virtualenv.

nanounanue avatar Dec 26 '17 17:12 nanounanue

Following the instructions in PR #148 I got:

If I execute M-! jupyter --version, I got 4.40 (so, no problem here), and then when I activate the debug-mode, I got the following message when I try to run any block, for example:

#+BEGIN_SRC ipython
print("hola")
#+END_SRC
* json-read()
  ob-ipython--collect-json()
  ob-ipython--execute-request("print(\"hola\")" "default")
  ob-ipython--execute-sync("print(\"hola\")" ((:colname-names) (:rowname-names) (:result-params "replace" "drawer") (:result-type . value) (:results . "replace drawer") (:exports . "both") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:session)))
  org-babel-execute:ipython("print(\"hola\")" ((:colname-names) (:rowname-names) (:result-params "replace" "drawer") (:result-type . value) (:results . "replace drawer") (:exports . "both") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:session)))
  #f(compiled-function (&optional arg info params) "Execute the current source code block.\nInsert the results of execution into the buffer.  Source code\nexecution and the collection and formatting of results can be\ncontrolled through a variety of header arguments.\n\nWith prefix argument ARG, force re-execution even if an existing\nresult cached in the buffer would otherwise have been returned.\n\nOptionally supply a value for INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptionally supply a value for PARAMS which will be merged with\nthe header arguments specified at the front of the source code\nblock." (interactive nil) #<bytecode 0x1871d41>)(nil ("ipython" "print(\"hola\")" ((:colname-names) (:rowname-names) (:result-params "drawer" "replace") (:result-type . value) (:results . "drawer replace") (:exports . "both") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 9617 "(ref:%s)") nil)
  ob-async-org-babel-execute-src-block(#f(compiled-function (&optional arg info params) "Execute the current source code block.\nInsert the results of execution into the buffer.  Source code\nexecution and the collection and formatting of results can be\ncontrolled through a variety of header arguments.\n\nWith prefix argument ARG, force re-execution even if an existing\nresult cached in the buffer would otherwise have been returned.\n\nOptionally supply a value for INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptionally supply a value for PARAMS which will be merged with\nthe header arguments specified at the front of the source code\nblock." (interactive nil) #<bytecode 0x1871d41>) nil ("ipython" "print(\"hola\")" ((:colname-names) (:rowname-names) (:result-params "drawer" "replace") (:result-type . value) (:results . "drawer replace") (:exports . "both") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 9617 "(ref:%s)"))
  apply(ob-async-org-babel-execute-src-block #f(compiled-function (&optional arg info params) "Execute the current source code block.\nInsert the results of execution into the buffer.  Source code\nexecution and the collection and formatting of results can be\ncontrolled through a variety of header arguments.\n\nWith prefix argument ARG, force re-execution even if an existing\nresult cached in the buffer would otherwise have been returned.\n\nOptionally supply a value for INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptionally supply a value for PARAMS which will be merged with\nthe header arguments specified at the front of the source code\nblock." (interactive nil) #<bytecode 0x1871d41>) (nil ("ipython" "print(\"hola\")" ((:colname-names) (:rowname-names) (:result-params "drawer" "replace") (:result-type . value) (:results . "drawer replace") (:exports . "both") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 9617 "(ref:%s)")))
  org-babel-execute-src-block(nil ("ipython" "print(\"hola\")" ((:colname-names) (:rowname-names) (:result-params "drawer" "replace") (:result-type . value) (:results . "drawer replace") (:exports . "both") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 9617 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x249b73>)(org-ctrl-c-ctrl-c nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x249b73>) org-ctrl-c-ctrl-c)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x249b73>) org-ctrl-c-ctrl-c)
  command-execute(org-ctrl-c-ctrl-c)

So, that doesn't seem to fix the problem

nanounanue avatar Dec 26 '17 18:12 nanounanue

Can you try doing the toggle-debug-on-error thing I mentioned above this? It looks like it's choking on something that's supposed to be JSON, but you can't actually see what the JSON is in your example.

nicholas-miklaucic avatar Dec 26 '17 23:12 nicholas-miklaucic

@nicholas-miklaucic After M-x toggle-debug-on-error, tried to execute the same block and I got

Debugger entered--Lisp error: (json-readtable-error . 27)
  signal(json-readtable-error 27)
  json-read()
  ob-ipython--collect-json()
  ob-ipython--execute-request("print(\"Hola\")" "default")
  ob-ipython--execute-sync("print(\"Hola\")" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:session)))
  org-babel-execute:ipython("print(\"Hola\")" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") (:session)))
  #f(compiled-function (&optional arg info params) "Execute the current source code block.\nInsert the results of execution into the buffer.  Source code\nexecution and the collection and formatting of results can be\ncontrolled through a variety of header arguments.\n\nWith prefix argument ARG, force re-execution even if an existing\nresult cached in the buffer would otherwise have been returned.\n\nOptionally supply a value for INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptionally supply a value for PARAMS which will be merged with\nthe header arguments specified at the front of the source code\nblock." (interactive nil) #<bytecode 0x1071ab5>)(nil ("ipython" "print(\"Hola\")" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 8235 "(ref:%s)") nil)
  ob-async-org-babel-execute-src-block(#f(compiled-function (&optional arg info params) "Execute the current source code block.\nInsert the results of execution into the buffer.  Source code\nexecution and the collection and formatting of results can be\ncontrolled through a variety of header arguments.\n\nWith prefix argument ARG, force re-execution even if an existing\nresult cached in the buffer would otherwise have been returned.\n\nOptionally supply a value for INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptionally supply a value for PARAMS which will be merged with\nthe header arguments specified at the front of the source code\nblock." (interactive nil) #<bytecode 0x1071ab5>) nil ("ipython" "print(\"Hola\")" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 8235 "(ref:%s)"))
  apply(ob-async-org-babel-execute-src-block #f(compiled-function (&optional arg info params) "Execute the current source code block.\nInsert the results of execution into the buffer.  Source code\nexecution and the collection and formatting of results can be\ncontrolled through a variety of header arguments.\n\nWith prefix argument ARG, force re-execution even if an existing\nresult cached in the buffer would otherwise have been returned.\n\nOptionally supply a value for INFO in the form returned by\n`org-babel-get-src-block-info'.\n\nOptionally supply a value for PARAMS which will be merged with\nthe header arguments specified at the front of the source code\nblock." (interactive nil) #<bytecode 0x1071ab5>) (nil ("ipython" "print(\"Hola\")" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 8235 "(ref:%s)")))
  org-babel-execute-src-block(nil ("ipython" "print(\"Hola\")" ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:results . "replace") (:exports . "code") (:session) (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no")) "" nil 8235 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x249b73>)(org-ctrl-c-ctrl-c nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x249b73>) org-ctrl-c-ctrl-c)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x249b73>) org-ctrl-c-ctrl-c)
  command-execute(org-ctrl-c-ctrl-c)

nanounanue avatar Dec 26 '17 23:12 nanounanue

Also, I am getting two buffers: ob-ipython-out (empty) and *ob-ipython-kernel-default* with the following:

Jupyter console 5.2.0

Python 3.6.2 (default, Dec  6 2017, 13:55:54) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.



In [1]: 

nanounanue avatar Dec 26 '17 23:12 nanounanue

I have jupyter 4.3.0. Perhaps that's important? If it is, this belongs as a separate bug.

On Tue, Dec 26, 2017 at 6:53 PM Adolfo De Unánue [email protected] wrote:

Also, I am getting two buffers: ob-ipython-out (empty) and ob-ipython-kernel-default with the following:

Jupyter console 5.2.0

Python 3.6.2 (default, Dec 6 2017, 13:55:54) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]:

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gregsexton/ob-ipython/issues/135#issuecomment-354026198, or mute the thread https://github.com/notifications/unsubscribe-auth/AZLD8c82XnZ93FbotCIfng5NqX54lJcYks5tEYcCgaJpZM4QMIhv .

nicholas-miklaucic avatar Dec 27 '17 02:12 nicholas-miklaucic

Actually my jupyter version is 4.4.0, the jupyter-console is 5.2.0 Which is your jupyter-console version? @nicholas-miklaucic

nanounanue avatar Dec 27 '17 06:12 nanounanue

5.2., my bad: didn't realize the version counters were different.

On Wed, Dec 27, 2017 at 1:04 AM Adolfo De Unánue [email protected] wrote:

Actually my jupyter version is 4.4.0, the jupyter-console is 5.2.0 Which is your jupyter-console version? @nicholas-miklaucic https://github.com/nicholas-miklaucic

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gregsexton/ob-ipython/issues/135#issuecomment-354058209, or mute the thread https://github.com/notifications/unsubscribe-auth/AZLD8RtXC9uuF6VHfI8QfbIaFHUAhgFYks5tEd3rgaJpZM4QMIhv .

nicholas-miklaucic avatar Dec 27 '17 12:12 nicholas-miklaucic

I am so confused with this error... could you share with me your configuration files for org-mode ? Maybe the problem is there, or maybe is the ob-ipython version?

nanounanue avatar Dec 28 '17 18:12 nanounanue

@nanounanue You could replace with-temp-buffer with with-temp-file, that should show you what it's choking on. Ref: https://github.com/gregsexton/ob-ipython/issues/135#issuecomment-349271131

dcherian avatar Dec 28 '17 19:12 dcherian

@dcherian What do you mean? Could you be more specific?

nanounanue avatar Dec 31 '17 04:12 nanounanue

You can set ob-ipython-command to the path of jupyter. e,g (setq ob-ipython-command "/home/name/miniconda3/bin/jupyter") . You can then restart emacs.

aayusuff avatar Dec 31 '17 16:12 aayusuff

@aayusuff I am using pyenv-mode for that. ob-ipython is picking the right path. But I will try your suggestion anyway.

nanounanue avatar Dec 31 '17 17:12 nanounanue