robert-dodier / maxima-jupyter

A Maxima kernel for Jupyter, based on CL-Jupyter (Common Lisp kernel)
Other
185 stars 31 forks source link

Doesn't recognize virtualenv-based Jupyter installation #82

Closed inducer closed 4 years ago

inducer commented 4 years ago

I have Jupyter installed in a virtualenv:

Python 3.7.7 (default, Apr  1 2020, 13:48:52) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jupyter
>>> jupyter.__file__
'/home/andreas/src/env-3.7/lib/python3.7/site-packages/jupyter.py'

However, when running jupyter_install();, I got the following output:

Installing kernel spec file /home/andreas/.local/share/jupyter/kernels/maxima/kernel.json
Installing kernel resources to /home/andreas/.local/share/jupyter/kernels/maxima/.
Installing local systems to /home/andreas/.local/share/maxima-jupyter/local-projects/

when I feel that, more sensibly, the kernel should have been installed into the virtualenv, i.e. at ~/src/env-3.7/share/jupyter/kernels. (and other resources analogously)

yitzchak commented 4 years ago

Does it successfully find the kernel?

Please note that jupyter_install(); does a user specific install, whereas ~/src/env-3.7/share/jupyter/kernels is probably virtualenv's version of the system path for kernels.

inducer commented 4 years ago

It does find the kernel, so I guess this is working as designed.

One final note: In order to get it to work, I had to hack the following lines into the start of ~/.local/share/maxima-jupyter/local-projects/maxima-jupyter/load-maxima-jupyter.lisp:

(require 'asdf)
(load "/home/andreas/quicklisp/setup.lisp")

(mirroring what I had to do in #81), otherwise the kernel would spew errors like

While evaluating the form starting at line 16, column 0
  of Maxima encountered a Lisp error:

 Component :MAXIMA-JUPYTER not found

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
#P"/home/andreas/.local/share/maxima-jupyter/local-projects/maxima-jupyter/load-maxima-jupyter.lisp":
While evaluating the form starting at line 16, column 0
  of #P"/home/andreas/.local/share/maxima-jupyter/local-projects/maxima-jupyter/load-maxima-jupyter.lisp":
inducer commented 4 years ago

Forgot to say: Thanks for your help!