ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 24 Feb 2021 22:24:17 +0100implicit_plot3d not rendering in Jupyter Labhttps://ask.sagemath.org/question/55896/implicit_plot3d-not-rendering-in-jupyter-lab/I'm unable to see any 3D plots in Jupyter Lab. I have tried forcing `viewer="threejs"` in the argument of a similar object, and have the same issue. Here's a screenshot of what it looks like: https://imgur.com/a/K8R3pZr. Any suggestions?
**Edit**: I'm running Ubuntu 20.10.
**Update**: I'm able to plot in Jupyter Notebook, so it's probably an issue with Jupyter Lab.
**Update**: forcing `viewer = "java3d"`,`viewer = "canvas3d"`, `viewer = "jsmol"` doesn't work either.
**Update**: I ran `sage -n jupyterlab` in the terminal. Everything seems to work fine until this:
`[W 2021-02-24 23:09:07.428 LabApp] Could not determine jupyterlab build status without nodejs`
`[W 2021-02-24 23:09:10.621 ServerApp] 404 GET /nbextensions/threejs/build/three.min.js (127.0.0.1) 19.83ms referer=http://localhost:8889/lab/tree/Jupyter/mcs_320/2-24.ipynb`
`[W 2021-02-24 23:09:10.624 ServerApp] 404 GET /nbextensions/threejs/examples/js/controls/OrbitControls.js (127.0.0.1) 2.01ms referer=http://localhost:8889/lab/tree/Jupyter/mcs_320/2-24.ipynb`
`[W 2021-02-24 23:09:10.686 ServerApp] 404 GET /nbextensions/threejs/examples/js/controls/OrbitControls.js (127.0.0.1) 2.08ms referer=http://localhost:8889/lab/tree/Jupyter/mcs_320/2-24.ipynb`
`[I 2021-02-24 23:09:10.815 ServerApp] Kernel started: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
`[W 2021-02-24 23:09:24.167 ServerApp] 404 GET /nbextensions/threejs/build/three.min.js (127.0.0.1) 1.86ms referer=http://localhost:8889/lab/tree/Jupyter/mcs_320/2-24.ipynb`
`[W 2021-02-24 23:09:24.170 ServerApp] 404 GET /nbextensions/threejs/examples/js/controls/OrbitControls.js (127.0.0.1) 1.88ms referer=http://localhost:8889/lab/tree/Jupyter/mcs_320/2-24.ipynb`
`[I 2021-02-24 23:10:30.056 ServerApp] Kernel shutdown: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
**Update**: Forcing `viewer = "tachyon"` works, but is not interactive.
**Update**: There must have been something wrong with how I installed Sage. I reinstalled using Anaconda and it works fine now.dfarmi2Wed, 24 Feb 2021 22:24:17 +0100https://ask.sagemath.org/question/55896/wsl W10 Ubuntu2004 JupyterLab future upgradehttps://ask.sagemath.org/question/55390/wsl-w10-ubuntu2004-jupyterlab-future-upgrade/HI
[Installing optional packages ](https://ask.sagemath.org/question/53294/installing-optional-packages-infinite-loop/?comment=55017#post-id-55017)
When SageMath9.3 will be released, do I wiil need to do only these commands ?
or will there be a shorter procedure
because the make will take a long time (3 hours on my old PC, and 2 hours on my new PC)
3.Download and extract the source tarball into a subfolder of your home directory
cd ~wget http://www.mirrorservice.org/sites/www.sagemath.org/src/sage-9.3.tar.gz
tar xvf sage-9.3.tar.gz
4.Start building
cd sage-9.3/
./configure
makeortolljWed, 20 Jan 2021 17:12:48 +0100https://ask.sagemath.org/question/55390/Problems running SageMath 9.2 in JupyterLabhttps://ask.sagemath.org/question/55245/problems-running-sagemath-92-in-jupyterlab/I installed SageMath 9.2 by following the instructions from https://doc.sagemath.org/html/en/installation/conda.html#sec-installation-conda and it works fine in terminal and Jupyter notebook, but it doesn't work in JupyterLab:
(base) paul@extra:~$ conda activate sage
(sage) paul@extra:~$ sage --notebook=jupyterlab
Jupyterlab is not installed (at least not in this Sage installation).
You can install it by running
sage -i jupyterlab_widgets
which includes support for interacts and the ability to download and
install other Jupyterlab extensions. For a minimal installation, run
sage -i jupyterlab
(sage) paul@extra:~$ sage -i jupyterlab
make: *** No rule to make target 'all-toolchain'. Stop.
BTW, JupyterLab is installed and works fine. Do I need additional configuration steps?pauljurczakTue, 12 Jan 2021 00:05:09 +0100https://ask.sagemath.org/question/55245/Error installing Jupyterlab in macOShttps://ask.sagemath.org/question/54560/error-installing-jupyterlab-in-macos/On macOS, with SageMath 9.2 installed via Conda, I tried to install Jupyterlab as follows:
(sage) $ sage -i jupyterlab_widgets
However, I get the following error message:
make: *** No rule to make target 'all-toolchain'. Stop.
The same error appears if I only try
(sage) $ sage -i jupyterlab
How can I avoid this error and complete the install?
Additional information. I am using a MacBook Pro with macOS 10.13.6,
and SageMath 9.2 was installed using conda as follows:
$ conda config --add channels conda-forge
$ conda config --set channel_priority strict
$ conda create -n sage sage python=3.8
I can launch SageMath in the Jupyter notebook with no problems using the commands:
$ conda activate sage
(sage) $ sage -n jupyter
Many thanks.JuanjoFri, 04 Dec 2020 18:23:09 +0100https://ask.sagemath.org/question/54560/update to 9.2 from 9.1 using conda ?https://ask.sagemath.org/question/54309/update-to-92-from-91-using-conda/Hello. I'm using Sage 9.1 in JupyterLab, installed by conda. Since days I'm looking for a way to upgrade to 9.2 (with conda) but I,ve foud none. Can someone help me? Many thanks
S.O. Elementary OS 5.1.7 Hera - Linux 5.4.0-54-genericJalpaFri, 20 Nov 2020 09:54:16 +0100https://ask.sagemath.org/question/54309/Creating a file for user defined functions using JupyterLab environment.https://ask.sagemath.org/question/54105/creating-a-file-for-user-defined-functions-using-jupyterlab-environment/I want to create a function in a separate file, and use that function in another one.
Here is the example:
#my_file.ipynb
def my_function(n):
return n*2
#main.ipnyb
attach('my_file.ipynb')
my_function(2)
But when doing this at the JupyterLab I receive the following erros:
(1) ValueError: unknown file extension '.ipynb' for load or attach (supported extensions: .py, .pyx, .sage, .spyx, .f, .f90, .m)
(2) NameError: name 'my_function' is not defined
This method seems to work for ***.sage*** files, but is not working for ***'.ipynb'***.
There is some way to accomplish the result demonstrated through my example using only JupyterLab environment?OshioTue, 03 Nov 2020 00:49:22 +0100https://ask.sagemath.org/question/54105/Interact in Jupyterlab vs Jupyterhttps://ask.sagemath.org/question/50194/interact-in-jupyterlab-vs-jupyter/Hello, Sage community!
I find Jupyterlab to be more comfortable than Jupyter, so I installed it with
sage -pip install jupyterlab
and I execute it with
sage -n jupyterlab
Everything work well, except when I try to execute an interact, in which case, no sliders, no selection boxes, etc. appear. However, if I use Jupyter with
sage -n jupyter
the interact works well.
Here is a minimal working example:
@interact
def const(k = slider(-5,5,0.1,1,label='Constant')):
print(k)
In this particular case, I obtain in Jupyterlab just `1.00000000000000` without any controls, nor the possibility to change the value of `k`.
Can somebody explain why it is not possible to use interacts in Jupyterlab while it is possible in Jupyter?dsejasMon, 09 Mar 2020 06:09:38 +0100https://ask.sagemath.org/question/50194/Syntax Highlight in JupyterLab Editorhttps://ask.sagemath.org/question/52334/syntax-highlight-in-jupyterlab-editor/Is there a way to have JupyterLab's editor highlight syntax in '.sage' files? (I'm using the version of JupyterLab installed from Sage itself.)lrfinottiSun, 05 Jul 2020 10:02:22 +0200https://ask.sagemath.org/question/52334/SageMath Tutorials not working inside JupyterLabhttps://ask.sagemath.org/question/49941/sagemath-tutorials-not-working-inside-jupyterlab/Summary: When I select Help for sagemath from the menu in Jupyterlab, the browser throws "`allow-same-origin`" errors in the console and eventually stops processing pages completely, showing "`math processing error`" for all formulas.
I am trying to add SageMath to our existing JupyterLab 1.2.6 installation inside a docker with an Ubuntu 18.04 image. I installed SageMath 9.0 and added SageMath to Jupyter via `jupyter kernelspec install ./local/share/jupyter/kernels/sagemath`.
Everything seems to run fine, except for the help:
- I select "Sage Documentation" from the Help menu in a SageMath notebook
- In the Web Browser console I get `The document is sandboxed and lacks the allow-same-origin flag`.
- While the document seems to be working anyway, going through the doucmentation yields an error for every single formula it encounters, specifically: `Access to font at XX (mathjax-font) from origin null has been blocked by CORS policy, No Access-Control-Allow-Origin header is present on the requested resource`.
- Still, it seems to be working somewhat, I think with the wrong fonts, but readable.
- At some point MathJax stops processing formulas completely and shows `Math Processing Error` for each formula.
I already tried setting allow-origin in the notebook configuration, but that did not change anything.
Anybody has a clue?
FrankwuebbelSun, 16 Feb 2020 10:00:42 +0100https://ask.sagemath.org/question/49941/SageMath and interact / ipywidgets with jupyterhttps://ask.sagemath.org/question/41269/sagemath-and-interact-ipywidgets-with-jupyter/I got the SageMath kernel working well inside my anaconda distribution's copy of jupyter, following [these instructions](https://stackoverflow.com/a/41595015), so I can open SageMath notebooks using anaconda jupyter and they run perfectly fine -- almost.
I would like to get interact elements / ipywidgets working when I use SageMath as a kernel in anaconda jupyter, but with my current configuration (hopefully described in sufficient detail below), I get the following error message in the console
>[IPKernelApp] WARNING | Widget Javascript not detected. It may not be installed or enabled properly.
and the notebook simply outputs the initial value of the function with no interactivity.
---
I'm running SageMath 8.1 on macOS. I've been able to get interact elements and ipywidgets with SageMath code running in the SageMath jupyter notebook interface (not sure if this was necessary, but I ran
`/local/bin/jupyter nbextension enable --py widgetsnbextension`
in the SageMath directory.) Everything works as expected, i.e. if I run `sagemath -n jupyter` and open a notebook containing:
>import ipywidgets as widgets
>
>widgets.IntSlider(
value=7,
min=0,
max=10,
step=1,
description='Test:',
disabled=False,
continuous_update=False,
orientation='horizontal',
readout=True,
readout_format='d'
)
I get a slider widget which works.
Similarly, examples from this [interact tutorial](https://wiki.sagemath.org/interact/graphics) on the SageMath wiki run perfectly fine in SageMath jupyter.
I also have an up-to-date anaconda install of jupyter where the ipywidgets nbextension has been enabled; the above ipywidgets code can be run in anaconda jupyter with the ordinary python kernel and works fine.
----
[The real reason I am asking this question is I would like to figure out how to get interactive widgets working in jupyterlab with the SageMath kernel, but I'm guessing that if the above question can be answered, I can get everything else working as well.]j.c.Mon, 26 Feb 2018 19:16:26 +0100https://ask.sagemath.org/question/41269/