ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 14 Nov 2020 15:26:23 -0600Is there any way to use SageMath on macOS Big Sur??https://ask.sagemath.org/question/54238/is-there-any-way-to-use-sagemath-on-macos-big-sur/I downloaded SageMath-9.2 on my mac,but every time I try ro use the notebook (by running "sage -n jupyter" on my terminal) I get the following massage:
" Please wait while the Sage Jupyter Notebook server starts... Traceback (most recent call last): File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/sage/repl/ipython_kernel/install.py", line 307, in have_prerequisites from notebook.notebookapp import NotebookApp File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/notebook/notebookapp.py", line 66, in from tornado import httpserver File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/site-packages/tornado/httpserver.py", line 29, in import ssl File "/Applications/SageMath-9.2.app/Contents/Resources/sage/local/lib/python3.8/ssl.py", line 98, in import _ssl # if we can't import it, let the error propagate ModuleNotFoundError: No module named '_ssl'
The Jupyter notebook requires ssl, even if you do not use https. Install the openssl development packages in your system and then rebuild Python (sage -f python3). " And also I can't open the app either for some reason ..... every time I click on the app I get a small window saying : "Jupyter Server failed to start" "For some reason the Jupyter server failed to start. Please check the log for clues, and have that information handy when asking for help."
I hope for some help, its very important for me because I must use SageMath for my college project.. thanks in advanceSafa AmashaSat, 14 Nov 2020 15:26:23 -0600https://ask.sagemath.org/question/54238/How to add .sws notebook files to SageNB so that I can convert them into .ipynb?https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/I have a bunch of .sws files, that were made (I suppose) with the now-deprecated sage notebook. Currently the default notebook application for Sage files is Jupyter, which cannot open these files. I tried
1. Using the built in "sagenb-export" command (ask.sagemath.org/question/35873/how-to-automatically-convert-many-sws-to-ipynb/) and also a standalone package (github.com/vbraun/ExportSageNB) in order to do it, but the notebook list in sagenb is empty (`sagenb-export --list` shows an empty list) and I could not make it to convert files that are not on this list. When running `sage -n`, there is an option "Convert old notebooks to Jupyter", but the list below that line is empty as well Is there a way of importing .sws files into this list?
2. An alternative way was to use the `-sws2rst` and `-rst2ipynb` flags that I found in an answer here (ask.sagemath.org/question/35873/how-to-automatically-convert-many-sws-to-ipynb/?answer=38197#post-id-38197), but that gives me `ModuleNotFoundError: No module named 'sagenb'`. Is it possible to install the sagenb module?RolfFri, 02 Oct 2020 09:07:19 -0500https://ask.sagemath.org/question/53703/EOL error in Sage-9.1https://ask.sagemath.org/question/53682/eol-error-in-sage-91/I want to modify a Python package for solving 'Quasi normal modes' using SageMath if possible, I want the below error to be fixed.
?qnm.modes_cache
grav_220 = qnm.modes_cache(s=-2, l=2, m=2, n=0)
omega, A, C = grav_220(a=0.68)
print('ω={}, A={}'.format(omega, A))
print('C={}''.format(C))
I get the error for the second input as
File "<ipython-input-13-1f77b2f8a4ef>", line 4
print('C={}''.format(C))
^
SyntaxError: EOL while scanning string literalsaxadThu, 01 Oct 2020 03:08:30 -0500https://ask.sagemath.org/question/53682/Sage on Jupyter - socket errorhttps://ask.sagemath.org/question/47455/sage-on-jupyter-socket-error/ When I try to start sage with the Jupyter notebook, I get this error:
:~/work> sage -n jupyter
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.8, Release Date: 2019-06-26 │
│ Using Python 2.7.15. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
Please wait while the Sage Jupyter Notebook server starts...
[I 13:23:55.592 NotebookApp] Using MathJax: nbextensions/mathjax/MathJax.js
[I 13:23:55.773 NotebookApp] Writing notebook server cookie secret to /run/user/1002/jupyter/notebook_cookie_secret
Traceback (most recent call last):
File "/home/rllozes/sage-8.8/src/bin/sage-notebook", line 267, in <module>
launcher(unknown)
File "/home/rllozes/sage-8.8/src/bin/sage-notebook", line 99, in __init__
main(argv)
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1635, in initialize
self.init_webapp()
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1407, in init_webapp
self.http_server.listen(port, self.ip)
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 142, in listen
sockets = bind_sockets(port, address=address)
File "/home/rllozes/sage-8.8/local/lib/python2.7/site-packages/tornado/netutil.py", line 197, in bind_sockets
sock.bind(sockaddr)
File "/home/rllozes/sage-8.8/local/lib/python2.7/socket.py", line 230, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address
Any idea why I get a socket error?
Richard_LFri, 09 Aug 2019 15:56:52 -0500https://ask.sagemath.org/question/47455/I broke jupyter (again)https://ask.sagemath.org/question/52313/i-broke-jupyter-again/I was trying to install some dark themes, so I ran
$ sage --pip install jupyterthemes
followed by
$ sage --pip install --upgrade jupyterthemes
as suggested [here](https://github.com/dunovank/jupyter-themes).
Then, when I launch
$ sage -n jupyter
the server seems to open correctly, but when trying to open an `.ìpynb` file, I get
500: internet server error
Sage itself is running, from the command line everything is o.k. More than that, running
$ sage -n jupyterlab
gives no problem at all: I can still run my notebooks.
Running sage 9.1 on Ubuntu 18.04. At some point I installed `hide_code` as per
[this thread](https://ask.sagemath.org/question/50277/how-to-install-hide_code-in-sagemath/).
Perhaps my problem comes from some broken dependencies?JCFri, 03 Jul 2020 07:33:08 -0500https://ask.sagemath.org/question/52313/inline help feature not working on jupyter notebookhttps://ask.sagemath.org/question/52746/inline-help-feature-not-working-on-jupyter-notebook/In prior Sage things that I've used, to get help with a particular function, say `matrix`, I would type `matrix?` then hit tab. However, this isn't working for me in the Jupyter notebook. avi.steinerWed, 29 Jul 2020 11:47:26 -0500https://ask.sagemath.org/question/52746/How to plot in seperate window using Jupyter notebook?https://ask.sagemath.org/question/52524/how-to-plot-in-seperate-window-using-jupyter-notebook/ Hello Guys,
I spend quite some time approximating a 1-manifold via a list of points, that I now want to plot. Is there a way to have a nice big window showing the interactive plot, instead of the small image, which is shown inline per default?
I'm using something like
plot = list_plot(firstList, plotjoined=True, color = 'blue')
plot += list_plot(secondList, plotjoined=True, color = 'red')
to plot two components of the manifold in one image. Sorry, but I can't show an screenshot of the output, because I'm new here and missing points (<60) to upload :( Alternatively, I tried adjusting the figsize, but nothing changed that way.
Thank you for your help!PaulEbertFri, 17 Jul 2020 04:17:39 -0500https://ask.sagemath.org/question/52524/Question about Jupyterhttps://ask.sagemath.org/question/51186/question-about-jupyter/ I am nearly novice in Sagemath and I would like to ameliorate the display of the cells.
For this I would like to install `Hide_code` but I am on windows 10 and the procedure to follow are written for Linux.
My second question is why Jupyter comes on windows ten without `view`?CyrilleFri, 01 May 2020 08:33:58 -0500https://ask.sagemath.org/question/51186/How to add extensions to Jupyter?https://ask.sagemath.org/question/51101/how-to-add-extensions-to-jupyter/Hi,
One can add extensions to Jupyter, as explained on the
[jupyter-contrib-nbextensions installation page](https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html),
for instance with the instruction:
pip install jupyter_contrib_nbextensions
But this instruction does not work using the SageMath 9.0 Shell (in Windows)... Any idea what to do?
RolandrolandTue, 28 Apr 2020 07:03:35 -0500https://ask.sagemath.org/question/51101/Table frame not showing in Jupyter Notebook and inconsistent in other environmentshttps://ask.sagemath.org/question/50600/table-frame-not-showing-in-jupyter-notebook-and-inconsistent-in-other-environments/ Hello, Sage community!
The `table` command in Sage has this useful option called `frame`. If I set `frame=True` in SageCell, CoCalc, the Sage terminal and SageTeX, the result is the expected: a frame is shown for the corresponding table. However, the same command does not work properly in Jupyter Notebooks. Also, the results are quite different in SageCell and CoCalc.
The following three images show the result of executing the following commands:
rows = [[100,2,3], [4,5,60]]
t = table(rows, frame=True)
show(t)
This is the result in SageCell:
![image description](/upfiles/15861892266090416.png)
This is the result in CoCalc:
![image description](/upfiles/1586189242468030.png)
This is the result in Jupyter (executed using `sage -n jupyter`):
![image description](/upfiles/15861892732930594.png)
Here are my questions:
1. Why is the `frame=True` option not working in Jupyter?
2. Why the difference in the results?
3. Is there any way to make these results consistent through these environments?dsejasMon, 06 Apr 2020 11:10:42 -0500https://ask.sagemath.org/question/50600/buttons on interact acting twice first timehttps://ask.sagemath.org/question/50325/buttons-on-interact-acting-twice-first-time/Hi
Ubuntu 18.04 Jupyter notebook SageMath 9.0
Q1):
I can't find why the first time I click on r or on t buttons it produces 2 rotations or 2 reflections, then only one as it should do, every other time.(maybe there is something wrong in my code ? )
(to enlarge the output cell, menu cell -> Current output → toggle scrolling and click on left side of the output cell)
Q2):
why this code do not work on SageCell , but works in my local server ?
precision: each time I change button then back to the other button is acting twice again !
or is there a bug in interact button ?
https://ask.sagemath.org/question/48338/interact-button-reacting-twice/
#%matplotlib notebook
#import matplotlib.pyplot as plt
#from matplotlib.animation import FuncAnimation
#import animatplot as amp
#
import numpy as np
from scipy.spatial import distance
from sage.plot.point import Point
#np.set_printoptions(linewidth=110)
""" choose side number of the 2D polygon """
var('n')
n=6
maL=[]
shiftAngle=-2*pi/(2*n)
for i in range(1,n+1) :
maL.append([cos(i*2*pi/n+shiftAngle),sin(i*2*pi/n+shiftAngle)])
#mL=[[1,1],[-1,1],[-1,-1],[1,-1]]
m=matrix(maL).transpose()
max = 1.5 # figure span
figsizeV=5
def chooseColor(colorsNumber):
if 'colorL' not in locals():
colorL=[]
for i in range(0,colorsNumber) :
colorL.append([random(),random(),random()])
#show(colorL)
D=distance.cdist(colorL, colorL, 'cityblock')
Dm=matrix(D)
DvL=[]
for v in (Dm.columns()):
DvL.append((sum(v)))
#show(DvL)
keys = range(len(DvL))
DvDict=dict(zip(DvL, keys))
#show(DvDict)
DvDictSorted={k: v for k, v in sorted(DvDict.items(), key=lambda item: item[0],reverse=True)}
#show(DvDictSorted)
colorSortedL=[]
for key,val in DvDictSorted.items():
colorSortedL.append(colorL[val])
#print (key, "=>", val)
return colorSortedL
rot=matrix(SR,[[cos(2*pi/n),-sin(2*pi/n)],[sin(2*pi/n),cos(2*pi/n)]])
#ref=matrix(SR,[[cos(2*2*pi/n),sin(2*2*pi/n)],[sin(2*2*pi/n),-cos(2*2*pi/n)]])
ref=matrix(SR,[[cos(pi),sin(pi)],[sin(pi),-cos(pi)]])
# fill up color list only if color list does not exist
try: colorSortedL
except NameError: colorSortedL = None
if colorSortedL ==None :
colorSortedL=chooseColor(2*n)
#print("https://www.youtube.com/watch?v=L5GEnUuhilw&t=204s")
#show(LatexExpr(r"\mathrm{rotation_{matrix}} = \begin{bmatrix}\cos{2\pi \over n} & -\sin{2\pi \over n} \\[8pt] \sin{2\pi \over n} & \cos{2\pi \over n}\end{bmatrix} "))
#show(LatexExpr(r"\mathrm{reflexion_{matrix}} = \left(\begin{array}{rr} \cos 2 \theta & \sin 2 \theta \\ \
# \sin 2 \theta & -\cos 2 \theta \end{array}\right)"))
#show("rotation Matrix :\t",rot)
#show("reflexion Matrix :\t",ref)
#show(maL)
#show(colorSortedL)
def getRotAndReflexionMatrix(rotAndRefSerie) :
global m
#show(rot,ref)
global rotAndReflexionMatricesL
global rotAndRefMemo
mrt=m
#show("rotAndRefMemo before:\t", rotAndRefMemo,"rotAndRefSerie :\t", rotAndRefSerie)
rotAndRefMemot=deepcopy(deepcopy(rotAndRefMemo) + deepcopy(rotAndRefSerie))
#show("rotAndRefMemo :\t", rotAndRefMemot,"rotAndRefSerie :\t", rotAndRefSerie)
rotAndReflexionMatricesL=[]
for c in rotAndRefMemot :
if c=='r' :
mrt=rot*mrt
rotAndReflexionMatricesL.append(mrt)
elif c=='t' :
mrt=ref*mrt
rotAndReflexionMatricesL.append(mrt)
elif c=='c' :
#clear
mrt=m
rotAndReflexionMatricesL=[m]
rotAndRefMemot=[ ]
else :
#clear
mrt=m
rotAndReflexionMatricesL=[ ]
rotAndRefMemot=[ ]
print("only i or r or t please")
#show("rotAndRefMemo :\t", rotAndRefMemo,"rotAndRefSerie :\t", rotAndRefSerie)
rotAndRefMemo=deepcopy(rotAndRefMemot)
return mrt
def buildMatriceFigPlots(matricesL):
figPlotsL=[]
figPlot=plot(0, ymin=-1.25, ymax=1.25)
for matrice in matricesL :
matriceL=list(matrice.transpose())
figPlot=(list_plot(matriceL,color='black',size=40,figsize=(figsizeV,figsizeV)))
for i in range(0,len(matriceL)) :
#show(matriceL[i])
figPlot+=text(str(i), matriceL[i], fontsize=50, rgbcolor=colorSortedL[i] )
figPlot+= polygon([matriceL[i],matriceL[(i+1)%n],(0,0)],fill=True, thickness=4, rgbcolor=colorSortedL[i])
figPlot += circle((0,0), 1)
#figPlot += polygon(matriceL,fill=False, thickness=4, color='orange')
figPlotsL.append(figPlot)
#for c in range(0,t.dimensions()[1]) :
#for r in range(0,t.dimensions()[0]) :
# show(r,":\t",r,":\t",t[r,c])
return figPlotsL
try: rotAndReflexionMatrix
except NameError: rotAndReflexionMatrix = None
if rotAndReflexionMatrix ==None :
rotAndReflexionMatrix=m
try: rotAndReflexionMatricesL
except NameError: rotAndReflexionMatricesL = None
if rotAndReflexionMatricesL ==None :
rotAndReflexionMatricesL=[]
try: rotAndRefMemo
except NameError: rotAndRefMemo = None
#
if rotAndRefMemo ==None :
rotAndRefMemo=[]
try: matricesFigPlotsL
except NameError: matricesFigPlotsL = None
if matricesFigPlotsL ==None :
matricesFigPlotsL=[]
animateTest=False
from IPython.core.display import display, HTML
#display(HTML("<style>.container { height:100% !important; }</style>"))
display(HTML("<style>.container { width:80% !important; }</style>"))
@interact
def _(aMap=selector(['c','r', 't'],buttons=True)):
rotAndRef=list(aMap)
#show("rotAnd Reflexion sequence: \t",rotAndRef)
global rotAndReflexionMatrix
global rotAndReflexionMatricesL
rotAndReflexionMatrix=getRotAndReflexionMatrix(rotAndRef)
#show("rotAndReflexionMatrix : \t",rotAndReflexionMatrix)
#show("rotAndReflexionMatricesL : \t",rotAndReflexionMatricesL)
# plot list of matrices
matricesFigPlotsL=buildMatriceFigPlots(rotAndReflexionMatricesL)
if animateTest :
# show animated sequence
a=animate(matricesFigPlotsL,ymin=-max,ymax=max,axes_labels=['x','y'],fontsize=14,figsize=(figsizeV,figsizeV))
a.show(delay=200,iterations=1)
else:
#only show the completed sequence at the end
if matricesFigPlotsL!=[] :
show(matricesFigPlotsL[-1])ortolljMon, 23 Mar 2020 04:36:54 -0500https://ask.sagemath.org/question/50325/Sage notebook only runs when a browser is already openhttps://ask.sagemath.org/question/49804/sage-notebook-only-runs-when-a-browser-is-already-open/I just installed sage 8.8 (it's not the newest sage, but it works for the most part) on my Linux machine and I had everything working at some point but the other day it isn't working as I'd expect it to be. When I do
$ sage -n jupyter --browser=firefox
in the terminal without Firefox opened, I get
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.8, Release Date: 2019-06-26 │
│ Using Python 2.7.15. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
Please wait while the Sage Jupyter Notebook server starts...
[I 09:42:16.791 NotebookApp] Using MathJax: nbextensions/mathjax/MathJax.js
[I 09:42:17.016 NotebookApp] The port 8888 is already in use, trying another port.
[I 09:42:17.016 NotebookApp] The port 8889 is already in use, trying another port.
[I 09:42:17.017 NotebookApp] The port 8890 is already in use, trying another port.
[I 09:42:17.017 NotebookApp] The port 8891 is already in use, trying another port.
[I 09:42:17.017 NotebookApp] The port 8892 is already in use, trying another port.
[I 09:42:17.023 NotebookApp] Serving notebooks from local directory: /home/user
[I 09:42:17.023 NotebookApp] The Jupyter Notebook is running at:
[I 09:42:17.024 NotebookApp] <local host>
[I 09:42:17.024 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 09:42:17.027 NotebookApp]
To access the notebook, open this file in a browser:
<server file>
Or copy and paste one of these URLs:
<localhost>
(I don't have enough karma to actually post the links but "local host" is the link to the notebook and "server file" is the HTML file in "/var/run/user/.../nbserver-...-open.html") which seems fine but Firefox doesn't appear to be open. When I try to open another Firefox browser, I get a message saying that there is already another browser opened when there isn't and I would have to kill the Firefox processes in order to open it again. Interestingly, when I try the same command again with a browser already opened, a new tab with the sage notebook appears.
I get the feeling that the problem could be coming from my init.sage file but I'm not sure if that would be the case.
~/.sage/init.sage:
==================================
from sage.misc.viewer import viewer
viewer.browser('open -a /usr/bin/firefox')
My environment variable SAGE_BROWSER is set to firefox:
$ echo $SAGE_BROWSER
firefox
If there's anything else that you'd like me to provide, let me know.BudRzWed, 05 Feb 2020 09:38:30 -0600https://ask.sagemath.org/question/49804/Output of @interact disappears when exporting Jupyter notebook to HTMLhttps://ask.sagemath.org/question/48563/output-of-interact-disappears-when-exporting-jupyter-notebook-to-html/I would like to write a Jupyter notebook that includes some interacts. When I export it to HTML the output of cells containing an interact disappears completely. The following screen captures shows the problem: the notebook is shown above, the corresponding HTML page appears below.
![image description](/upfiles/1572489201647630.png)
![image description](/upfiles/15724893284633615.png)
I was hoping that, at least, an image of the initial state of the interact will be shown. Is there a way to automatically replace the interact output by an image when exporting to HTML?JuanjoWed, 30 Oct 2019 21:37:13 -0500https://ask.sagemath.org/question/48563/Problems with AMS symbols in Sage, Jupyterhttps://ask.sagemath.org/question/48303/problems-with-ams-symbols-in-sage-jupyter/ How to display the square (\square) symbol in a graph (Jupyter, maybe not only). Why \boxtimes is too large?
plot(x, (x,-1,10), axes_labels=[r'$F(G\,\square\,H)$',r'$F(G\,\times\,H)$']).show()
plot(x, (x,-1,10), axes_labels=[r'$F(G\,\square\,H)$',r'$F(G\,\times\,H)$']).show()
I tried \box \square \emptybox etc. and
from sage.misc.latex import latex_extra_preamble
latex.add_to_preamble('\\usepackage{amssymb}')
I get:
ValueError:
F(G\,\square\,H)
^
Unknown symbol: \square (at char 5), (line:1, col:6)
SYLASat, 12 Oct 2019 09:42:12 -0500https://ask.sagemath.org/question/48303/interact button reacting twicehttps://ask.sagemath.org/question/48338/interact-button-reacting-twice/I'm trying to update some old interact to the new Jupyter notebook. I'd like
to have an interact with buttons, something like the following:
act = []
@interact
def play(move=selector([None] + ["Auto", "Reset"], buttons=True)):
act.append(move)
print(act)
However when I press a new button, the applet receive it twice. For example,
if I press "Auto" and the "Reset" it prints
[None, 'Auto', 'Auto', 'Reset', 'Reset']
instead of
[None, 'Auto', 'Reset']
Is it expected ? HivertMon, 14 Oct 2019 14:16:47 -0500https://ask.sagemath.org/question/48338/Problems with AMS symbols in Sage, Jupyterhttps://ask.sagemath.org/question/48302/problems-with-ams-symbols-in-sage-jupyter/ How to display the square (\square) symbol in a graph (Jupyter, maybe not only). Why \boxtimes is too large?
plot(x, (x,-1,10), axes_labels=[r'$F(G\,\square\,H)$',r'$F(G\,\times\,H)$']).show()
plot(x, (x,-1,10), axes_labels=[r'$F(G\,\square\,H)$',r'$F(G\,\times\,H)$']).show()
I tried \box \square \emptybox etc. and
from sage.misc.latex import latex_extra_preamble
latex.add_to_preamble('\\usepackage{amssymb}')
I get:
ValueError:
F(G\,\square\,H)
^
Unknown symbol: \square (at char 5), (line:1, col:6)
SYLASat, 12 Oct 2019 09:39:14 -0500https://ask.sagemath.org/question/48302/Convert existing notebook to Jupyterhttps://ask.sagemath.org/question/47140/convert-existing-notebook-to-jupyter/ Hi, I try to pass from sagenb to jupyter. I follow the recommandation on trac.sagemath.org
When I run the command
> sage -n export --list
I obtain the following error.
Traceback (most recent call last):
File "/usr/bin/sage-notebook", line 266, in <module>
launcher(unknown)
File "/usr/bin/sage-notebook", line 135, in __init__
os.execvp(SAGENB_EXPORT, [SAGENB_EXPORT] + argv)
File "/usr/lib/python2.7/os.py", line 346, in execvp
_execvpe(file, args)
File "/usr/lib/python2.7/os.py", line 382, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
Thanks for your helpfylouFri, 12 Jul 2019 07:09:40 -0500https://ask.sagemath.org/question/47140/Interact layout in Jupyter-Notebookhttps://ask.sagemath.org/question/47120/interact-layout-in-jupyter-notebook/When I run this code
@interact(layout=dict(top=[['f', 'color']],
left=[['axes'],['fill']],
bottom=[['zoom']]))
def _(f=input_box(x^2,width=20),
color=color_selector(widget='colorpicker', label=""),
axes=True,
fill=True,
zoom=range_slider(-3,3, default=(-3,3))):
show(plot(f,(x,zoom[0], zoom[1]), color=color, axes=axes,fill=fill))
in Jupyter notebook, the controls are not organised as specified. But this is not so with the old SageNB notebook. How can I make the controls specified in the `layout` parameter to appear in the output as originally specified? Please advise.eocanseyWed, 10 Jul 2019 16:49:30 -0500https://ask.sagemath.org/question/47120/Opening "old" Sage Notebooks in Jupyter: not UTF-8 encodedhttps://ask.sagemath.org/question/46943/opening-old-sage-notebooks-in-jupyter-not-utf-8-encoded/I've decided to pay attention to the "Sage Notebook is Deprecated" message at the top of all of my Notebooks, and convert everything into Jupyter. So it seems that I'm got Jupyter running on my system (through Anaconda), but when I save all my SageMath notebooks (as .sws files, since that seems to happen by default), and open them in Jupyter, (I'm running Jupyter with "sage -n jupyter"), I get the message in the notebook that the file is not UTF-8 encoded, and nothing else (sorry, I can't for the life of me seem to cut and paste this exact message from the Jupyter notebook...).
I did a little searching and at least discovered this:
$ file -bi Embedded\ Torus\ in\ Invariant\ Coordinates\ \(S3\ Scale\ Factor\,\ Bump\).sws
$ application/x-bzip2; charset=binary
So this file (and all my Sage Notebook Files) have "binary" listed as the character set. That seems bad to me - if it's a character set, shouldn't it be ASCII at least, or something?
Anyone know how I can get these notebooks into Jupyter? I can go back and save them as something different if I knew what I needed to do.thethinkerWed, 19 Jun 2019 09:32:32 -0500https://ask.sagemath.org/question/46943/Sage Notebook crashes immediatelyhttps://ask.sagemath.org/question/46075/sage-notebook-crashes-immediately/New installation of Windows binaries, version 8.6 (Windows installer 0.4.2), on 64-bit Windows 8.1 system with 8GB of RAM. Clicking on the "SageMath 8.6 Notebook" desktop icon opens a terminal window and displays the message "Please wait while the Sage Jupyter Notebook server starts", but the window closes within 2 or 3 seconds.
Would appreciate any guidance on troubleshooting - happy to study any relevant documentation if someone can point me in the right direction.
When running `sage --notebook=jupyter` in the shell I get:
[I 17:51:21.659 NotebookApp] Using MathJax: nbextensions/mathjax/MathJax.js Traceback (most recent call last):
File "/opt/sagemath-8.6/src/bin/sage-notebook", line 268, in <module> launcher(unknown)
File "/opt/sagemath-8.6/src/bin/sage-notebook", line 100, in __init__ main(argv)
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/jupyter_core/application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/traitlets/config/application.py", line 657, in launch_instance app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_error return method(app, args, *kwargs)
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1629, in initialize self.init_webapp()
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/notebook/notebookapp.py", line 1408, in init_webapp self.http_server.listen(port, self.ip)
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 142, in listen sockets = bind_sockets(port, address=address)
File "/opt/sagemath-8.6/local/lib/python2.7/site-packages/tornado/netutil.py", line 197, in bind_sockets sock.bind(sockaddr)
File "/opt/sagemath-8.6/local/lib/python2.7/socket.py", line 230, in meth return getattr(self._sock,name)(*args)
socket.error: [Errno 1] Operation not permittedrixensoTue, 09 Apr 2019 23:57:42 -0500https://ask.sagemath.org/question/46075/add entire tab column in Jupyter notebook?https://ask.sagemath.org/question/45048/add-entire-tab-column-in-jupyter-notebook/Hi
Just to point out that it's a pity, that pressing the alt key,
simultaneously with a continuous press on the left mouse button,
which allows you to delete or add an entire column of characters in Word, Google Doc, or Notepad ++,
does not exist in Jupyter-notebook editor.
Is there a way to add an entire tab column in Jupyter-notebook editor ?.
So far, when I have to move a block of code on the side,
I copy it in Notepad ++ and I use the alt key, and then I re-copy it in the editor Jupyter-notebook. ortolljTue, 15 Jan 2019 01:09:25 -0600https://ask.sagemath.org/question/45048/How to configure jupyter for Sage-specific use?https://ask.sagemath.org/question/45025/how-to-configure-jupyter-for-sage-specific-use/I am an absolute beginner in using jupyter-notebooks.
Since SageMath version 8.5 the user is asked to be prepared for using jupyter as the standard notebook in the future.
So, in Linux I activate jupyter with ./ sage -n jupyter and do some experiments.
In this way, obviously, SageMath activates an internal jupyter package via an internal notebook-interface (and not via an external jupyter installation e.g. in anaconda).
I tried also to edit python code within a jupyter cell. I got some unexpected errors, so editing code in jupyter cells seems to be problematic. Also, I want to figure out, why editing python code within a jupyter cell changes the color marks of some 'if' statements to red? Sometimes, after re-opening a closed jupyter session appears as plain text only, i.e., without cells.
My simple question is therefore: Is there any documentation available for the sage-specific use of jupyter (e.g., meaning of color code for the elements of the python language, extra necessary import of additional sage objects for jupyter, configuration of jupyter, etc)?.
bekalphSat, 12 Jan 2019 11:00:58 -0600https://ask.sagemath.org/question/45025/