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.Sun, 29 Nov 2020 12:24:26 +0100Error: No module named 'sagenb'https://ask.sagemath.org/question/54441/error-no-module-named-sagenb/SageMath is not working on Ubuntu 20.04. When I am going to open notebook interface it show the following errors:
https://imgur.com/a/aQQkUSQ
How can I fix this?MKSSun, 29 Nov 2020 12:24:26 +0100https://ask.sagemath.org/question/54441/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 16:07:19 +0200https://ask.sagemath.org/question/53703/How to change width of output in sagemath notebook?https://ask.sagemath.org/question/51729/how-to-change-width-of-output-in-sagemath-notebook/ I am working with big matrices and when I want to print them rows of matrix don't fit in one line of output and it is broken up although there is space on the screen left. Such printing makes matrix unreadable is there anyway to change this?Dominik StępieńWed, 03 Jun 2020 19:18:11 +0200https://ask.sagemath.org/question/51729/Run sage notebook without sage.all importedhttps://ask.sagemath.org/question/47805/run-sage-notebook-without-sageall-imported/When I create a create a sage Jupyter notebook the kernel seems to always run `from sage.all import *`.
This can be useful since you don't have to worry about importing all the things you need. However I find it has two big disadvantages:
- The sage kernel takes a while to start (roughly one minute for me)
- It causes naming conflicts when we define a function or class that already has a meaning somewhere in the huge sage library.
Therefore I wonder if it is possible to run a notebook with a sage kernel without importing the entire sage library.
TilpoMon, 09 Sep 2019 12:25:11 +0200https://ask.sagemath.org/question/47805/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 14:09:40 +0200https://ask.sagemath.org/question/47140/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 16:32:32 +0200https://ask.sagemath.org/question/46943/3d plots flattened when printing to filehttps://ask.sagemath.org/question/41312/3d-plots-flattened-when-printing-to-file/When I print to file using The Sage Notebook (flask) - clicking the print option and then printing to file using CUPS - everything is displayed correctly except plot3d plots which are squeezed to have a height of a few centimeters while the width remains the same. I do not have the same problem with other types of plots like "plot" or "countourplot".
I do not know whether this has anything to do with my screen being 4k, but it reminds me of similar picture scaling issues I have with maple.
What I get: https://s17.postimg.org/d3q80qlf3/screenshot.png
What I expected: https://s17.postimg.org/72sj3vokv/screenshot.pngPoetastropheWed, 28 Feb 2018 18:48:39 +0100https://ask.sagemath.org/question/41312/"mesh=" juypter vs. -notebookhttps://ask.sagemath.org/question/35802/mesh-juypter-vs-notebook/Perhaps I should send this to some devel or support group ?
Starting command line:
sage -notebook
Comes up and executes:
var('x,y')
plot3d(sin(x-y)*y*cos(x),(x,-3,3),(y,-3,3), mesh=True)
Correctly.
Whereas:
sage -n jupyter
Fails with miscellaneous assertion type errors.
sagemath 7.3 in both cases.
A friend also point out the option "color='yellow' " also fails in jupyter.
----------
Edit (slelievre):
I confirm I can observe this also with Sage 7.4. Here is the error message I get:
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-3-44b2387a145a> in <module>()
----> 1 plot3d(sin(x-y)*y*cos(x),(x,-Integer(3),Integer(3)),(y,-Integer(3),Integer(3)), mesh=True)
/opt/s/sage-7.4/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in __call__(self, result)
244 self.start_displayhook()
245 self.write_output_prompt()
--> 246 format_dict, md_dict = self.compute_format_data(result)
247 self.update_user_ns(result)
248 self.fill_exec_result(result)
/opt/s/sage-7.4/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in compute_format_data(self, result)
148
149 """
--> 150 return self.shell.display_formatter.format(result)
151
152 # This can be set to True by the write_output_prompt method in a subclass
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/display/formatter.pyc in format(self, obj, include, exclude)
158 # First, use Sage rich output if there is any
159 PLAIN_TEXT = u'text/plain'
--> 160 sage_format, sage_metadata = self.dm.displayhook(obj)
161 assert PLAIN_TEXT in sage_format, 'plain text is always present'
162 if sage_format.keys() != [PLAIN_TEXT]:
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in displayhook(self, obj)
764 self._backend.set_underscore_variable(obj)
765 plain_text, rich_output = self._rich_output_formatter(obj, dict())
--> 766 return self._backend.displayhook(plain_text, rich_output)
767
768 def display_immediately(self, obj, **rich_repr_kwds):
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_ipython.pyc in displayhook(self, plain_text, rich_output)
525 from sage.repl.display.jsmol_iframe import JSMolHtml
526 jsmol = JSMolHtml(rich_output, height=500)
--> 527 return ({u'text/html': jsmol.iframe(),
528 u'text/plain': plain_text.text.get_unicode(),
529 }, {})
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/display/jsmol_iframe.py in iframe(self)
259 </iframe>
260 """
--> 261 escaped_inner_html = self.inner_html().replace('"', '"')
262 iframe = IFRAME_TEMPLATE.format(
263 script=self.js_script(),
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/display/jsmol_iframe.py in inner_html(self)
235 """
236 return INNER_HTML_TEMPLATE.format(
--> 237 script=self.js_script(),
238 width=self._width,
239 height=self._height,
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/display/jsmol_iframe.py in js_script(self)
193 """
194 script = [r"["]
--> 195 for line in self.script().splitlines():
196 script += [r" '{0}',".format(line)]
197 script += [r"].join('\n');"]
/opt/s/sage-7.4/src/sage/misc/cachefunc.pyx in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (/opt/s/sage-7.4/src/build/cythonized/sage/misc/cachefunc.c:12716)()
2399 if self.cache is None:
2400 f = self.f
-> 2401 self.cache = f(self._instance)
2402 return self.cache
2403
/opt/s/sage-7.4/local/lib/python2.7/site-packages/sage/repl/display/jsmol_iframe.py in script(self)
156 command, obj, meshfile = line.split(' ', 3)
157 assert command == 'pmesh'
--> 158 assert meshfile.startswith('"') and meshfile.endswith('"\n')
159 meshfile = meshfile[1:-2] # strip quotes
160 script += [
AssertionError:rrogersWed, 30 Nov 2016 00:42:58 +0100https://ask.sagemath.org/question/35802/Build Error when Uploading Notebooks in Sagehttps://ask.sagemath.org/question/38486/build-error-when-uploading-notebooks-in-sage/Running Fedora 26 as a virtual machine, I recently installed Sage 8.0 from source (and was thrilled to see support for Jupiter....amazing!). Besides a minor error coming from Open SSL which I'll try to run down later, Sage seems to work perfectly, until I try to upload one or more zipped notebook files into the Sage Notebook. On screen, after uploading, I get a non descriptive "500:internal error" message. In the terminal, I get the message "Build Error:Could not build url for endpoint 'home' with values ['username']. Did you mean 'worksheet_listing.home' instead?" If the notebook is a new notebook (one which I didn't just download from Sage and reimport for diagnostic purposes) clicking on "continue" allows me to see and interact with the new notebooks. However, if I then exit Sage and restart it and the notebook, I get a 500:internal error in both the sage and jupiter notebooks and nothing else displayed (no link to "continue" to the notebooks or anything else). In the terminal I get a much longer error, which I've copied at the end of my message. Does anyone have any suggestions as to where to start trying to fix this? I've searched the forum, and not seen similar errors, but maybe I missed something. (I read that for a while Sage had import errors with files containing nonascii characters, so I'll add that I can recreate this behavior using a file called "Test" with the single line "1+1" contained in it, as well as using files exported from both a Sage 8.0 server and an older server I am still running.)
Any advice would be greatly appreciated!
----------
(Longer error follows here:)
[E 10:45:37.351 NotebookApp] Uncaught exception GET /sagenb?token=06fdd6ab20a2cd845ccc2c9a972faa770df9dcf12814aeb8 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/sagenb?token=06fdd6ab20a2cd845ccc2c9a972faa770df9dcf12814aeb8', version='HTTP/1.1', remote_ip='::1', headers={'Accept-Language': 'en-US,en;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Host': 'localhost:8888', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36', 'Connection': 'keep-alive', 'Cookie': '_xsrf=2|5673a5cc|62623cc6f31eb0ee368868cc418cc7ed|1501627626; sphinxsidebar=visible; username-localhost-8888="2|1:0|10:1502116964|23:username-localhost-8888|44:NDcxZTQ2OTQ1NmVhNDdiYTg4MjczZTJhNjQ3NmI5YWI=|2d1454b6f339bb26417cd7cf5b7b9c8149292440579ff0ec9e52ddf5ec225aa0"', 'Upgrade-Insecure-Requests': '1'})
Traceback (most recent call last):
File "/home/ashicks/Sage/sage-8.0/local/lib/python2.7/site-packages/tornado/web.py", line 1443, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/home/ashicks/Sage/sage-8.0/local/lib/python2.7/site-packages/tornado/web.py", line 2800, in wrapper
return method(self, *args, **kwargs)
File "/home/ashicks/Sage/sage-8.0/local/lib/python2.7/site-packages/sagenb_export/nbextension/list_handler.py", line 35, in get
notebooks=tuple(self.notebook_iter()),
File "/home/ashicks/Sage/sage-8.0/local/lib/python2.7/site-packages/sagenb_export/nbextension/list_handler.py", line 22, in notebook_iter
for notebook in NotebookSageNB.all_iter(dot_sage)
File "/home/ashicks/Sage/sage-8.0/local/lib/python2.7/site-packages/sagenb_export/nbextension/list_handler.py", line 22, in <genexpr>
for notebook in NotebookSageNB.all_iter(dot_sage)
File "/home/ashicks/Sage/sage-8.0/local/lib/python2.7/site-packages/sagenb_export/sagenb_reader.py", line 217, in sort_key
return (self.conf['owner'], self.conf['id_number'])
KeyError: 'owner'
[E 10:45:37.381 NotebookApp] {
"Accept-Language": "en-US,en;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36",
"Connection": "keep-alive",
"Cookie": "_xsrf=2|5673a5cc|62623cc6f31eb0ee368868cc418cc7ed|1501627626; sphinxsidebar=visible; username-localhost-8888=\"2|1:0|10:1502116964|23:username-localhost-8888|44:NDcxZTQ2OTQ1NmVhNDdiYTg4MjczZTJhNjQ3NmI5YWI=|2d1454b6f339bb26417cd7cf5b7b9c8149292440579ff0ec9e52ddf5ec225aa0\"",
"Upgrade-Insecure-Requests": "1"
}
[E 10:45:37.381 NotebookApp] 500 GET /sagenb?token=06fdd6ab20a2cd845ccc2c9a972faa770df9dcf12814aeb8 (::1) 37.04ms referer=NoneAngelaHMon, 07 Aug 2017 17:12:08 +0200https://ask.sagemath.org/question/38486/Sagenotebook hangs on arch linux?https://ask.sagemath.org/question/37986/sagenotebook-hangs-on-arch-linux/This is the error.
[error](https://ptpb.pw/hnvK)
I just did install from the pacman repo -sagemath and the notebook?
![hangs](https://ptpb.pw/m4NN.png )screened00Sat, 17 Jun 2017 19:29:44 +0200https://ask.sagemath.org/question/37986/Deleting old users on sagenotebookhttps://ask.sagemath.org/question/36262/deleting-old-users-on-sagenotebook/ Hi, I have installed a sage notbook server, which is running in a school. Pupils create their accounts, but don't use it anymore after graduation. How can I find accounts, which haven't been used for longer than a year and delete them?
Is it possible that i can see in the "Manage User" tab, when a user last edited a worksheet? Can this function be added?
Thanks a lot
msageThu, 12 Jan 2017 06:58:19 +0100https://ask.sagemath.org/question/36262/Current State of Sage Notebooks?https://ask.sagemath.org/question/36002/current-state-of-sage-notebooks/I was just curious as to what the current plan for notebooks in sage are. If open the sage notebook server the command windows states "Please wait while the old SageNB Notebook server starts..." But that still seems to be the default. There is also the option to use jupyter notebook. Is that going to be the new default? The ArchWiki seems to state just that: [ArchWiki](https://wiki.archlinux.org/index.php/SageMath#Sage_Notebook)
To summarize, there is "the old SageNB", jupyter, and the Sage Math Cloud notebook, is there a plan for what is the default or recommended option?rtcTue, 13 Dec 2016 16:28:26 +0100https://ask.sagemath.org/question/36002/How do I log into Sage Notebook 7.2?https://ask.sagemath.org/question/35082/how-do-i-log-into-sage-notebook-72/After updating to Sierra, I am prompted to log into Sage Notebook v 7.2. There is a space for me to enter my username and password which I do not remember... There are no other links on the page.
How do I log in?
jblakeleyFri, 07 Oct 2016 02:38:08 +0200https://ask.sagemath.org/question/35082/VM Virtualbox & sage-7.2.ova: how to start?https://ask.sagemath.org/question/33850/vm-virtualbox-sage-72ova-how-to-start/I downloaded and loaded sage-7.2.ova, opened localhost:8000/edit/notebook-browser, but do not know what to do next. There is no command "Run" or something like that.DSblizzardSun, 19 Jun 2016 20:06:21 +0200https://ask.sagemath.org/question/33850/Integrate SAGE Jupyter Notebook in Anaconda Python Distributionhttps://ask.sagemath.org/question/32741/integrate-sage-jupyter-notebook-in-anaconda-python-distribution/ Hello, i'm Eduardo Vieira a Mechanical Engineering student from Venezeula. I use Python for everything and now i'm looing to Sage but is there a way to integrate Sage with the Jupyter Notebook? To get sage in the Notebook i have to run sage -ipython but i want to have the Sage kernel avaible when i run jupyter notebook.
I am using the Anaconda python distribution in Ubuntu Linux.
Thanks and sorry for my english, i know it is really bad.
EduardoJVWed, 09 Mar 2016 02:42:59 +0100https://ask.sagemath.org/question/32741/Confirmation dialog for manipulation with more than one worksheet in Sage Notebook.https://ask.sagemath.org/question/32647/confirmation-dialog-for-manipulation-with-more-than-one-worksheet-in-sage-notebook/Hello!
This is not really a question but a feature request for **Sage Notebook**. It would be nice to have a **confirmation dialog** while attempting to **archive or delete more than one worksheet at once**.
I just accidentally deleted all my worksheets because (clicked 'Delete' rather than 'Download'). And since there is no 'Undo' option, I for one would appreciate if the system would want me to confirm that action. In case of one worksheet it would be a distraction because of it is easy to undelete a single worksheet, but it is rather difficult to "fish" a lot of worksheets out of the trash.EugeneWed, 24 Feb 2016 00:01:31 +0100https://ask.sagemath.org/question/32647/init.sage doesn't work for the notebook server?https://ask.sagemath.org/question/32513/initsage-doesnt-work-for-the-notebook-server/Hello!
I have the same problem as in [Is there a way to prefix all sage code in order to include a custom module?](http://ask.sagemath.org/question/8407/is-there-a-way-to-prefix-all-sage-code-in-order-to-include-a-custom-module/), but the init.sage appears not to work with notebook's worksheet. Here is what I have:
$ cat ~/.sage/init.sage
import numpy as np
then inside Sage I have:
$ ./sage
sage: np
<module 'numpy' from ....>
But then I run notebook() and create a new worksheet, inside that worksheet session:
np
NameError: name 'np' is not defined
So I assume that **the script was not executed for the worksheet**.
Is there a way to create sage.init but for the worksheets?EugeneTue, 09 Feb 2016 21:15:20 +0100https://ask.sagemath.org/question/32513/VM Virtualbox & sage-7.0.ova: how to start?https://ask.sagemath.org/question/32344/vm-virtualbox-sage-70ova-how-to-start/Hi,
I downloaded sage-7.0.ova and I imported it in VM Virtualbox. <b>What are the next steps?</b>
Using http://localhost:8000/home/admin within my browser doesn't work, as it did up to sage-6.10.ova. <br>
The information on https://wiki.sagemath.org/SageAppliance isn't helpful. <br>
Also https://groups.google.com/forum/#!topic/sage-support/CacnfZbIGiI didn't give much information.
Are these the steps for Sage-7.0 for Windows / VM Virtualbox? <br>
1) load sage-7.0.ova as normal in VM Virtualbox <br>
2) Go to http://localhost:8000/tree within your browser <br>
3) On the top right select New and than SageMath 7.0 <br>
4) You see at the top Jupyter Notebook Untitled <br>
5) You have to select Run instead of pressing Enter to perform a command <br>
<b>If so, how to upload my *.sws files?</b>
Thanks for answering.
RolandbWed, 27 Jan 2016 09:07:12 +0100https://ask.sagemath.org/question/32344/How to embed a 3D matplotlib figure in the notebook interface?https://ask.sagemath.org/question/32079/how-to-embed-a-3d-matplotlib-figure-in-the-notebook-interface/I'd like to embed a matplotlib figure in the notebook interface of SageMath, is this possible? Presently I am using this SageMath code:
x,y,z=var('x,y,z')
# Next we define the parameters
sigma=10
rho=40
beta=8/3
# The Lorenz equations
lorenz=[sigma*(y-x),x*(rho-z)-y,x*y-beta*z]
# Time and initial conditions
N=250000
tmax=150
h=tmax/N
times=srange(0,tmax+h,h)
ics=[0,1,1]
sol=desolve_odeint(lorenz,ics,times,[x,y,z],rtol=1e-13,atol=1e-14)
X=sol[:,0]
Y=sol[:,1]
Z=sol[:,2]
# Plot the result
from mpl_toolkits.mplot3d import axes3d
from matplotlib import pyplot as plt
def plot():
fig = plt.figure(1)
ax = fig.add_subplot(111, projection='3d')
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
ax.set_xlabel('X(t)')
ax.set_ylabel('Y(t)')
ax.set_zlabel('Z(t)')
plt.show()
plot()
to solve and plot the solution to the Lorenz equations. What modification to the `plot()` function do I have to make in order to embed the matplotlib plot in the notebook interface. Fusion809Tue, 05 Jan 2016 09:51:50 +0100https://ask.sagemath.org/question/32079/Sharing files between Sage and Windowshttps://ask.sagemath.org/question/31091/sharing-files-between-sage-and-windows/ Hi, I am new to sage and now I have really strange question. My sage is running in Oracle VM because I have WIN7. Because I work at two places, I need to transfer the files between to computers. I want to copy and store worksheets from Sage Notebook. And this is the problem. I am not able to save my work properly using the Sage Notebook. I set up in Oracle VM the Shared Folder. Ok, but all I am able to do is to save some html of the worksheet. I would like to store the files *.sws directly, not some dummy html. I was not able to find out something in manuals. How can I do this? Or is there another way? I don't want to use some cloud - only my flash-drive. **For me it suffices to know how to save the worksheet file (*.sws) into the shared folder.**
Thank YoujanThu, 26 Nov 2015 20:38:01 +0100https://ask.sagemath.org/question/31091/Changing ssl configurationhttps://ask.sagemath.org/question/29907/changing-ssl-configuration/Greetings,
I have a sage server for my students. I have a ssl cert (and a CA) for the server address, but I do not know how to tell sage notebook to use it instead of the one it generates. Note that it is a running server used by many students (around 200), so I can not try many things.
Regards,
José Luis José LuisSat, 10 Oct 2015 19:27:03 +0200https://ask.sagemath.org/question/29907/Printing typeset output in the notebook?https://ask.sagemath.org/question/29495/printing-typeset-output-in-the-notebook/I'm sure this is a very trivial question, but I've not been able to find a simple answer.
If I use a `print` statement within a loop then the output so produced is not typeset, even though I have the typeset box ticked, and results of single commands are typeset. Is there an alternative to `print` which produces typeset output? I'm using Sage 6.2 in Ubuntu 14.04.
Thanks!AlasdairSat, 19 Sep 2015 11:34:49 +0200https://ask.sagemath.org/question/29495/unicode decode error when downloading zip-filehttps://ask.sagemath.org/question/26858/unicode-decode-error-when-downloading-zip-file/ Tried to Download worksheet files from my sage notebook in my Ubuntu 14.04 and got the following error messages. Any idea how to fix the problem?
---
Found the reason to the problem: it's an UniCodeError as follows.
2015-05-17 19:07:57+0300 [HTTPChannel,88,127.0.0.1] Starting zipping a group of worksheets in a separate thread...
2015-05-17 19:07:59+0300 [-] WSGI application error
Traceback (most recent call last):
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/python/threadpool.py", line 196, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/web/wsgi.py", line 332, in run
self.reactor.callFromThread(wsgiError, self.started, *exc_info())
--- <exception caught here> ---
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Twisted-14.0.2-py2.7-linux-i686.egg/twisted/web/wsgi.py", line 315, in run
appIterator = self.application(self.environ, self.startResponse)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/simo/Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/flask_version/decorators.py", line 22, in wrapper
return f(*args, **kwds)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/flask_version/worksheet_listing.py", line 214, in download_worksheets
g.notebook.export_worksheet(worksheet.filename(), sws_filename)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/notebook/notebook.py", line 741, in export_worksheet
S.export_worksheet(username, id_number, output_filename, title=title)
File "/home/.../Sage/sage-6.4.1-i686-Linux/local/lib/python2.7/site-packages/sagenb-0.11.1-py2.7.egg/sagenb/storage/filesystem_storage.py", line 468, in export_worksheet
f.write(old_heading + g.read())
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 446: ordinal not in range(128)
---simoMon, 18 May 2015 11:33:24 +0200https://ask.sagemath.org/question/26858/How to copy notebook worksheet data from one computer to anotherhttps://ask.sagemath.org/question/26844/how-to-copy-notebook-worksheet-data-from-one-computer-to-another/ Hi, I have a number of sage notebook worksheets in my old ubuntu laptop. I need to get a copy of them to my new ubuntu laptop as well as to another win8.1 laptop. Need to work with then locally without internet connection in my boat, so it's a critical issue for me.simoSat, 16 May 2015 17:34:21 +0200https://ask.sagemath.org/question/26844/Changes in figure HTML layout in 6.5?https://ask.sagemath.org/question/26217/changes-in-figure-html-layout-in-65/ I am trying to layout the figures drawn by plot() using raw html. In 6.3 and 6.4 it worked, but got broken in 6.5. My code is:
html('<table><tr><td><table><tr><td>')
plot(sin).show(figsize=[2,1.4])
html('</td></tr><tr><td>')
plot(cos).show(figsize=[2,1.4])
html('</td></tr></table></td><td>')
print(version())
print('Plots of sine and cosine\nare to the left ')
html('</td></tr></table>')
In 6.3, the <img> tags are embedded exactly into the places where the show() function is called, but in 6.5 all the figures are in the end and not embedded into the table. Was this change intentional? Can anyone propose a workaround? My application relies a lot on such formatting.ADuC812Tue, 17 Mar 2015 14:30:00 +0100https://ask.sagemath.org/question/26217/How do I register so I can use the Sage Notebookshttps://ask.sagemath.org/question/25663/how-do-i-register-so-i-can-use-the-sage-notebooks/ I am a brand new Sage user, and have installed Sage on my Mac running Yosemite. I want to use the Sage notebooks but Sage is asking me to log in with a user id and password. Where in the Sage website can I register a user id and password? I can't seem to find it.rdfuhrSun, 01 Feb 2015 08:32:25 +0100https://ask.sagemath.org/question/25663/Attaching files in notebook does not update contentshttps://ask.sagemath.org/question/25611/attaching-files-in-notebook-does-not-update-contents/ Hello, I am running Sage 6.4.1. Using the notebook interface, attaching files does not work as the files contents are not reloaded automatically. It just shows me the previous variable values.
echo "x=2" > foo.py
attach foo.py
x
2
echo "x=4" > foo.py
x
2
As you can see the value of x isn't updated to 4. I can confirm that attach works as intended on the terminal, just the notebook interface is broken.NahsiNTue, 27 Jan 2015 04:30:02 +0100https://ask.sagemath.org/question/25611/How to delete blank text cellshttps://ask.sagemath.org/question/25299/how-to-delete-blank-text-cells/When I create a text cell and then click "Cancel Changes", the text cell does not delete and it stays taking up extra space in the notebook. Has anyone else encountered this? If so, then how do I go about deleting the extra blank text cells created?NahsiNFri, 19 Dec 2014 04:14:35 +0100https://ask.sagemath.org/question/25299/Sage notebook doesn't work [solved]https://ask.sagemath.org/question/25157/sage-notebook-doesnt-work-solved/ Hi!
I installed sage 6.4.1 and launched sage notebook.<br>
I press shift-enter and get new line. <br>
I press enter and get new line too.... <br>
Also I found that sage notebook doesn't save my input. <br>
Then I saw in terminal and found there are many problems. <br>
It seems for me Flask doen't work. <br>
I didn't have any problems during installing sage. <br>
I attached log to my message. (UPD: [Link to log file](https://cloud.mail.ru/public/be30e6360bf8/sage_log.txt) )<br>
Please help me.
Andrei.AndreWinSun, 07 Dec 2014 11:17:51 +0100https://ask.sagemath.org/question/25157/evaluation button in sage notebook 6.4https://ask.sagemath.org/question/24883/evaluation-button-in-sage-notebook-64/ Dear all,
I have just upgraded to Sage 6.4.
But now, when I use the notebook() environment, there is no evaluation button after a block.
Also, pressing shift+enter only starts a new line, but does not initiate evaluation?
Currently my only option to use the evaluate all functio, but this is unsatisfactory.
What can I do?
Thank you in advance.
EDIT: This problem seems to be firefox related, since in safari I have the optionmathethSun, 16 Nov 2014 17:50:48 +0100https://ask.sagemath.org/question/24883/