Ask Your Question

Iguananaut's profile - activity

2019-01-16 04:31:11 -0600 commented answer Loading a 5GB dictionary of matrices uses up all of 64GB RAM

Or for something that large, a binary format.

2019-01-16 04:29:51 -0600 commented question sage 8.5 windows jupyter can't work

Clicking the icon would have the same problem since it's just running sage -n jupyter essentially. You have to open the shell and then override your default language settings so that Jupyter doesn't try to use its zh_CN translation, which clearly does not work well on Python 2 :(

2019-01-15 11:04:04 -0600 commented question sage 8.5 windows jupyter can't work

I was able to reproduce this simply by running $ LANGUAGE=zn_CN jupyter notebook. Pretty bad. Try running $ LANGUAGE=en_US jupyter notebook or, if LANGUAGE doesn't work you can try one of LC_ALL, LC_MESSAGES, LANG, etc. as described at

2019-01-15 10:53:20 -0600 commented question sage 8.5 windows jupyter can't work

This was also reported as though the response was less than helpful.

2019-01-15 10:48:02 -0600 commented question sage 8.5 windows jupyter can't work

Nevermind, it seems Juypter's internationalization efforts will just do this automatically

2019-01-14 07:34:54 -0600 commented question max memory used during a process

Although I've never used it directly myself, I believe I've seen some people produce reports from memory-profiler before.

2019-01-14 07:31:35 -0600 commented question max memory used during a process

Off the top of my head, no, I don't think so. One could write such a utility (in fact such utilities likely already exist outside sage) to track memory usage of a process over some period of time (e.g. start and stop of some computation). It would also have to track memory usage across child processes as many computations can launch subprocesses, either to run other programs, or to parallelize the computation. This make computing the exact memory usage a bit tricky since parallel processes in particular will use a lot of shared memory.

2019-01-14 06:45:37 -0600 commented question How to configure jupyter for Sage-specific use?

Indeed, normally the Sage Jupyter kernel works fine at least for most basic use cases, so you'll have to be more specific. Sage has its own kernel for Jupyter so normally there isn't any "sage-specific" configuration needed (although sometimes there is fidgeting needed for things like 3D plots).

Is it possible you're running some additional plugins/add-ons in Jupyter that might interact badly? The experience you seem to be describing is not typical.

2019-01-08 04:33:54 -0600 received badge  Nice Answer (source)
2019-01-07 07:24:06 -0600 commented answer Error in SageMath Code which crash my PC

You'd have to describe what you mean by "crashing the PC". What does that mean? Does it get slow? Does the browser crash? Does the OS BSOD?

2019-01-07 07:22:24 -0600 commented question How do I solve this installation problem?
2019-01-07 07:21:10 -0600 answered a question Cannot install SageMath on Ubuntu 16.04: "Maximum recursion depth exceeded"

This is a known issue that was resolved in Sage 8.5: Another workaround is to install python2 and ensure that PYTHON=python2.

2019-01-07 07:11:49 -0600 commented answer Sage Floyd algorithm in Cython

I added a note about this to

2019-01-07 07:00:26 -0600 commented answer Sage Floyd algorithm in Cython

scipy is a dependency of Sage anyways, so there doesn't seem to be any reason for Sage to maintain its own inferior implementation of this algorithm when at most it could just wrap the one from scipy.

2018-12-04 16:45:37 -0600 received badge  Good Answer (source)
2018-12-01 01:41:46 -0600 received badge  Nice Answer (source)
2018-11-30 06:43:54 -0600 commented question Show that one variable is negative based on assumptions

Deleted duplicate.

2018-11-29 16:07:25 -0600 received badge  Nice Answer (source)
2018-11-29 16:05:20 -0600 received badge  Nice Answer
2018-11-29 04:03:33 -0600 answered a question How to pack sage-8.4 armv7l built as compressed re-distributable binaries?

For starters you might want to look at the micro_release target in in the Makefile. Try running make micro_release: it prunes quite a lot of stuff.

Start with that and see where it gets you; there might be more opportunities here and there beyond that.

2018-11-29 03:58:33 -0600 commented question Where to Set the environment variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent make from removing what has built so far?

I see now that you're saying it's getting "stuck" building the documentation. There is a known bug that the parallelized docbuild can hang in low-memory environments, which definitely is your case. You can mitigate it somewhat by running SAGE_NUM_THREADS=1 make doc. But I might suggest not building the docs on your RaspPi at all (just run make build to build everything but the docs) and, if you need to have the local HTML docs available, build them on a different system and copy them over. The Sage docbuild is very resource intensive.

2018-11-29 03:55:11 -0600 commented question Where to Set the environment variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent make from removing what has built so far?

I'm not sure what you're referring to in that log. It looks like the docs built successfully, minus one possibly spurious warning.

Upon re-reading your original post I think you're confused about the use of SAGE_KEEP_BUILT_SPKGS=yes. Your confusion is understandable--it shouldn't be outputting that message. That's just a generic message for some make target failures, but it's not applicable to the Sage documentation build.

2018-11-29 03:51:09 -0600 commented question How to use the divergence of a finite function as the source term of another problem

Hello--regretfully I don't have the knowledge to answer your question, though I'm sure someone will be along who can. Just as a side-note, when posting code please make sure it's properly marked as code. You can do this by selecting the code block and clicking the "format as code" button in the post editor, or by pressing Ctrl-K. I've gone ahead and taken care of it for you this time.

2018-11-28 02:44:35 -0600 commented question Where to Set the environment variable SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent make from removing what has built so far?

When running any shell command you can pass environment variables to it like:

$ SAGE_KEEP_BUILT_SPKGS=yes make build

If you want do it once for the same shell session do


If you want to keep some variables between shell sessions the way to do that is (depending on your shell) to set them in your local rc file for your shell (most shells will read .profile so you can put export <WHATEVER> there). This is just the general way to set environment variables.

Don't go modifying files in Sage's sources unless you know exactly what you're doing because they might get overwritten or otherwise not persist somehow.

It would be nice if SAGE_ variables like this were saved when running sage's ./configure, however.

2018-11-28 02:39:32 -0600 commented question Windows 10: SageMath crashes on start with permission errors, but seems to work if I run "as administrator"

Is it possible you had a previous version of Sage installed under a different user? Try deleting your .sage directory or changing the permissions on it.

2018-11-28 02:31:10 -0600 commented question How to avoid "flags"?

The "best" solution to dealing with deeply nested loops like this is often going to depend on the particular problem at hand. In this case you might write this as a specialized iterator and then loop over the combinations with a single for loop. Fortunately, this particular iterator has alread been written and you can do this like:

from itertools import combinations
for p, q, r in combinations(prime_range(2, N), 3):
    if n != p*q + q*r + r*p:

This way avoids lot of duplicate work as well, since it avoids recalculating prime_range([x > 2], N) so many times.


2018-11-26 05:12:32 -0600 commented question How to avoid "flags"?

What do you mean by "flags" or "modern programming"? It depends on the exact logic, but in Python usually some boolean flag is the best way to break out of nested loops. Raising some exception can be another way.

2018-11-26 05:07:59 -0600 commented answer Installing Sagemath 8.4 on WSL Ubuntu 18.04

@rijndaelxyz What do you mean by "in terms of performance"? What specifically are your areas of concern there? For most usage it is fine, but if you need to compile your own specialized BLAS or something like that it's better to build from source currently (in fact, if high performance is a concern it's probably better to use the Docker image, but only in specialized cases).

2018-11-26 05:05:38 -0600 commented question Installing Sagemath 8.4 on WSL Ubuntu 18.04

We are in the process of updating the sagemath package for Debian, probably 8.4 or 8.5, or possibly something later depending on how it all shakes out. Once sagemath in Debian is updated it will probably also be updated in a future Ubuntu release. But the old sagemath package in Ubuntu is somewhat unmaintained. I also have no idea how well it actually works in WSL.

2018-11-26 05:04:06 -0600 commented answer Installing Sagemath 8.4 on WSL Ubuntu 18.04

@slelievre : Sage does not work on conda on Windows. There are not Windows packages for Sage or its dependencies on conda (in particular: I need to add a channel for cygwin binaries for conda...)

To clarify, it might work when using conda under WSL but I've never tested that...

2018-11-12 12:08:17 -0600 commented question How can I most easily configure the SageVM?
2018-11-06 03:27:18 -0600 commented question Problem with %attach on version 8.3. with Windows 10

I've opened an issue about this here: The error you're getting could be related as well, even though it's exhibiting in a different way. I'm not 100% sure about that though.

2018-11-06 03:19:54 -0600 commented question Problem with %attach on version 8.3. with Windows 10

Sorry, I have no idea. You might have a virus scanner or something interfering with the newly compiled DLL... Strangely, when I try using %attach on a .pyx or .spyx file on the newly release Sage 8.4 I just get a file not found error, which is also not so good.

2018-11-06 03:08:49 -0600 commented question How to write a GUI in sage

@joaoff Tkinter is not easy to install. If it didn't come compiled with the Python distribution it is not easy to otherwise install. It does not necessarily come with Sage by default, though a system version can easily be installed.

@RootUser you talked about using VirtualBox to run Sage? What do you mean by that exactly? Regardless if you want to develop a native GUI (as opposed to something web-based) I would recommend using a GUI toolkit provided by your system (e.g. installing the native wxWidgets for your OS) and wrapping Sage as though it were a black box. I.e. don't worry about running your GUI code with the same Python that is used to run Sage.

2018-11-02 12:53:53 -0600 commented question How to attach a simple Sage script in a Sage Jupyter notebook

The issue you're getting with attach() looks like a bit of a bug though. I don't think it's particular to Windows either. Even if it is "expected" from a coding perspective it is certainly unexected and unhelpful from a user perspective.

2018-11-02 12:35:00 -0600 commented question How to write a GUI in sage

AFAIK there is no officially supported way to install the wx library or wxPython in the Sage environment. You could do it, of course, but you'd have to do so manually. I think a better bet would be to use a GUI toolkit supplied by your system and use it to wrap Sage (but that depends on what exactly you're trying to do and how).

2018-10-08 10:28:23 -0600 received badge  Good Answer (source)