@@ -125,14 +125,20 @@ convenience, it is possible to link your installation of SageMath into
125
125
your Jupyter installation, adding it to the list of available kernels
126
126
that can be selected in the notebook or JupyterLab interface.
127
127
128
- If ``$SAGE_LOCAL `` is the installation prefix of your Sage
129
- installation (the default is ``$SAGE_ROOT/local ``) and you can start
130
- the Jupyter notebook by typing ``jupyter notebook ``, then the
131
- following command will install SageMath as a new kernel.
128
+ Assuming that SageMath can be invoked by typing ``sage ``, you can use
132
129
133
130
.. CODE-BLOCK :: bash
134
131
135
- jupyter kernelspec install --user $SAGE_LOCAL /share/jupyter/kernels/sagemath
132
+ sage -sh -c ' ls -d $SAGE_VENV/share/jupyter/kernels/sagemath'
133
+
134
+ to find the location of the SageMath kernel description.
135
+
136
+ Assuming that the Jupyter notebook can be started by typing ``jupyter notebook ``,
137
+ the following command will install SageMath as a new kernel.
138
+
139
+ .. CODE-BLOCK :: bash
140
+
141
+ jupyter kernelspec install --user $( sage -sh -c ' ls -d $SAGE_VENV/share/jupyter/kernels/sagemath' )
136
142
137
143
This installs the kernel under the name ``sagemath ``. If you wish to
138
144
rename it to something more specific in order to distinguish between
@@ -141,32 +147,35 @@ different installations of SageMath, you can use the additional option
141
147
142
148
.. CODE-BLOCK :: bash
143
149
144
- jupyter kernelspec install --user $SAGE_LOCAL /share/jupyter/kernels/sagemath --name sagemath-dev-worktree
150
+ jupyter kernelspec install --user $( sage -sh -c ' ls -d $SAGE_VENV /share/jupyter/kernels/sagemath' ) --name sagemath-dev-worktree
145
151
146
152
The ``jupyter kernelspec `` approach by default does lead to about 2Gb of
147
- sagemath documentation being copied into your personal jupyter configuration
153
+ SageMath documentation being copied into your personal jupyter configuration
148
154
directory. You can avoid that by instead putting a symlink in the relevant spot.
149
- Assuming that sagemath is properly installed, you can use
155
+ and
150
156
151
157
.. CODE-BLOCK :: bash
152
158
153
- sage -sh -c ' ls -d $SAGE_LOCAL/share/jupyter/kernels/sagemath '
159
+ jupyter --paths
154
160
155
- to find location of the sagemath kernel description and
161
+ to find valid data directories for your Jupyter installation.
162
+ A command along the lines of
156
163
157
164
.. CODE-BLOCK :: bash
158
165
159
- jupyter --paths
166
+ ln -s $( sage -sh -c ' ls -d $SAGE_VENV/share/jupyter/kernels/sagemath ' ) $HOME /.local/share/jupyter
160
167
161
- to find valid data directories for your jupyter installation.
162
- A command along the lines of
168
+ can then be used to create a symlink to the SageMath kernel description
169
+ in a location where your own ``jupyter `` can find it.
170
+
171
+ If you have installed SageMath from source, the alternative command
163
172
164
173
.. CODE-BLOCK :: bash
165
174
166
- ln -s ` sage -sh -c ' ls -d $SAGE_LOCAL/ share/jupyter/kernels/sagemath' ` $HOME /.local/share/jupyter
175
+ ln -s $( sage -sh -c ' ls -d $SAGE_ROOT/venv/ share/jupyter/kernels/sagemath' ) $HOME /.local/share/jupyter
167
176
168
- can then be used to create a symlink to the sagemath kernel description
169
- in a location where your own `` jupyter `` can find it .
177
+ creates a symlink that will stay current even if you switch to a different Python version
178
+ later .
170
179
171
180
To get the full functionality of the SageMath kernel in your global
172
181
Jupyter installation, the following Notebook Extension packages also
0 commit comments