jkitchin / scimax

An emacs starterkit for scientists and engineers
Other
1.03k stars 123 forks source link

ipython call fails with a json readtable error message #478

Closed Arjay-El closed 1 year ago

Arjay-El commented 1 year ago

Org babel blocks using python work fine but ipython blocks all fail with a "json readtable error:99". Does anyone know why and how to fix this error?

Arjay-El commented 1 year ago

Further to my message, the Messages buffer shows this comment:

Executing Ipython unknown at position 1... json-read: JSON readtable error: 99

when I run this test code:

#+BEGIN_SRC ipython :output both
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

t = np.linspace(0, 20 * np.pi, 350)
x = np.exp(-0.1 * t) * np.sin(t)
y = np.exp(-0.1 * t) * np.cos(t)

plt.plot(x, y)
plt.axis('equal')

plt.figure()
plt.plot(y, x)

plt.axis('equal')

print('Length of t = {}'.format(len(t)))
print('x .dot. y = {}'.format(x @ y))

plt.savefig("fig1.jpg")
plt.show()
#+END_SRC
Arjay-El commented 1 year ago

Seems that jupyter-python works fine without these strange json errors so converting scripts to jupyter-python.

jkitchin commented 1 year ago

This json-read: JSON readtable error: 99 probably means some jupyter command is printing some non-json error messages, e.g. a kernel is missing or something. Something like this was seen before (https://github.com/jkitchin/scimax/issues/453#issuecomment-1131618047). The solution is definitely to move on to emacs-jupyter.