Skip to content

sage jupyter kernel installation #7

@jamesdbrock

Description

@jamesdbrock

Hi, thanks for upgrading sage-notebook to Python 3.

I just tried to build the new sage-notebook on my Jupyter Docker Stacks and it seemed to succeed, but the kernel didn't get installed. Here is what I logged from the docker build:

Step 10/11 : RUN echo '         from sage.repl.ipython_kernel.install import SageKernelSpec;         SageKernelSpec.update(prefix=os.environ["CONDA_DIR"]);     ' | conda run -n sage sage &&     echo '         cat $SAGE_ROOT/etc/conda/activate.d/sage-activate.sh |             grep -Po '"'"'(?<=^export )[A-Z_]+(?=)'"'"' |             jq --raw-input '"'"'.'"'"' | jq -s '"'"'.'"'"' |             jq --argfile kernel $SAGE_LOCAL/share/jupyter/kernels/sagemath/kernel.json             '"'"'. | map(. as $k | env | .[$k] as $v | {($k):$v}) | add as $vars | $kernel | .env= $vars'"'"' >             $CONDA_DIR/share/jupyter/kernels/sagemath/kernel.json     ' | conda run -n sage sh &&     fix-permissions $CONDA_DIR &&     fix-permissions /home/$NB_USER
 ---> Running in 1cd1a6de97e0
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.7.6. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
Setting permissions of DOT_SAGE directory so only you can read and write it.
sage: Exiting Sage (CPU time 0m0.01s, Wall time 0m0.05s).

Removing intermediate container 1cd1a6de97e0
 ---> 010851b05c19
Step 11/11 : RUN echo '         ls /opt/conda/envs/sage/share/jupyter/kernels/ |             grep -Po '"'"'python\d'"'"' |             xargs -I % sh -c '"'"'                 cd $SAGE_LOCAL/share/jupyter/kernels/% &&                 cat kernel.json |                     jq '"'"'"'"'"'"'"'"' . | .display_name = .display_name + " (sage)" '"'"'"'"'"'"'"'"' >                     kernel.json.modified &&                 mv -f kernel.json.modified kernel.json &&                 ln  -s $SAGE_LOCAL/share/jupyter/kernels/% $CONDA_DIR/share/jupyter/kernels/%_sage             '"'"'     ' | conda run -n sage sh &&     fix-permissions $CONDA_DIR &&     fix-permissions /home/$NB_USER
 ---> Running in a91f1aeb3be0
Removing intermediate container a91f1aeb3be0
 ---> e199441b437e

And now:

(base) jovyan@c6e9f4c17cdc:~$ jupyter kernelspec list
Available kernels:
  ir           /opt/conda/share/jupyter/kernels/ir
  julia-1.3    /opt/conda/share/jupyter/kernels/julia-1.3
  python3      /opt/conda/share/jupyter/kernels/python3
  haskell      /usr/local/share/jupyter/kernels/haskell

So I'm not sure what happened, I'm investigating. I have a question. Where does the $SAGE_LOCAL variable in the Dockerfile get set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions