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, 14 Jul 2024 21:57:12 +0200Sagemath 9.5 vs Sagemath 10.3https://ask.sagemath.org/question/78266/sagemath-95-vs-sagemath-103/12345678910l3gi0nSun, 14 Jul 2024 21:57:12 +0200https://ask.sagemath.org/question/78266/Why doesn't 'sage -n jupyterlab' open correctly ?(localhost refused to connect)https://ask.sagemath.org/question/69219/why-doesnt-sage-n-jupyterlab-open-correctly-localhost-refused-to-connect/I installed Sage and JupyterLab in WSL (Arch Linux).
sudo pacman -S sagemath
sudo pacman -S jupyterlab
Its command line seems to work fine.
![image description](/upfiles/16869225072647058.png)
However, after the first run of `sage -n jupyterlab` that successfully opens JupyterLab, I cannot open JupyterLab again after restarting my computer.
![image description](/upfiles/16869227459720784.png)
Even if I copied those URL-like links it mentioned.
![image description](/upfiles/16869232511349827.png)
How should I adjust it correctly?lichengFri, 16 Jun 2023 15:41:58 +0200https://ask.sagemath.org/question/69219/How to troubleshoot a sage database not accessible after install?https://ask.sagemath.org/question/69029/how-to-troubleshoot-a-sage-database-not-accessible-after-install/ I installed from source SageMath 10 on Ubuntu (WSL) to be able to use FriCas and to take a look at the database `sage.databases.odlyzko.zeta_zeros()`. Unfortunately, I don't have the compute skills to make it happen. On the second point (the database), I installed it within the directory where I had installed sage with the command `sage -i database_odlyzko_zeta`, and then tried to use it within a Jupyter NB by first calling the database (?) as
sage.databases.odlyzko.zeta_zeros()
AttributeError: module 'sage.databases' has no attribute 'odlyzko'
and then
zz = zeta_zeros()
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/odlyzko/zeros.sobj'
Does the last error message mean that I had to install it in `/usr/share`? How can I find this database? Can I move it? What am I missing?
toniTue, 06 Jun 2023 13:55:30 +0200https://ask.sagemath.org/question/69029/Trouble installing the Kohel databasehttps://ask.sagemath.org/question/67192/trouble-installing-the-kohel-database/ I am trying to install the Kohel database but running into an error I don't understand.
From what I gathered online I should run `sage -i database_kohel` in my Linux terminal, but this is giving me the following error : `make: *** No rule to make target 'all-toolchain'. Stop.`
I am running Sage 9.5 in WSL using an Ubuntu terminal.
Any help would be appreciated!stillconfusedThu, 30 Mar 2023 22:24:32 +0200https://ask.sagemath.org/question/67192/Rendering 3D Objects error in Sage with WSL/VSCode/Jupyter Notebookhttps://ask.sagemath.org/question/67099/rendering-3d-objects-error-in-sage-with-wslvscodejupyter-notebook/As the title suggests, whenever I try to render anything in 3D (a polygon, for example) in a Jupyter notebook in VSCode using the Sagemath kernal with WSL, the output is just a blank space that is approximately the size of what the output graph is suppose to look like.
If I try to switch from the text/html to text/plain, the original render would change to one line of "Graphics3d Object."
Is there a fix to this?
Thanks! SW_kMon, 27 Mar 2023 03:09:00 +0200https://ask.sagemath.org/question/67099/New ways to install Sage failed ; Need helphttps://ask.sagemath.org/question/66844/new-ways-to-install-sage-failed-need-help/I am sorry to be obliged to ask this question. Until now, I was using the old Sagemath version with an automatic installation on Windows 10. But I would like to be update. Secondly, I use Sagemath in courses, and I need student to install it. Of course they can use Sagecell but I prefer to use Jupiter notebooks to interact with them. So if I understand correctly, there is two ways now to install Sagemath on my computer :
1) Docker Sagemath. So Docker has been installed on my computer (for two days it was installed but the start was non stopping so I supposed that a correction has been applied). Now I went in the site `https://hub.docker.com/r/sagemath/sagemath`, copy `docker pull sagemath/sagemath` and run it in PowerShell. Then inside Powershell running `docker run -it sagemath/sagemath:latest` I have a perfect version of a command line Sagemath.
Here comes my problem : running ` docker run -p8888:8888 sagemath/sagemath:latest sage-jupyter` returns the following error `docker: Error response from daemon: driver failed programming external connectivity on endpoint kind_kirch (58408cd6ac6e671d23cf5f9875de73bd013477b6ebb526ba499cc00d9e68c78f): Bind for 0.0.0.0:8888 failed: port is already allocated.`
Inside Docker I have closed all the containers and even if I worked from Docker, I could not have a jupiter notebooks. I have tried to search on internet to find what went wrong but I hav not founded any usefull information. Could some one help me.
2) the second way is to use wsl2 and install Ubuntu and then Sagemath in Ubuntu. But in that case, when installing sagemath inside Ubuntu I have always errors some comming from mathplot-lib.
I have constructed all my Operation Research on Sagemath and I need to have a simple way to install it. Not only for me but mainly for my students who are not computer scientists.CyrilleWed, 08 Mar 2023 19:20:47 +0100https://ask.sagemath.org/question/66844/best and easy way to install SageMath in W11https://ask.sagemath.org/question/66159/best-and-easy-way-to-install-sagemath-in-w11/Hi
as I got kernel connection problem see [pb SageMath kernel connection](https://ask.sagemath.org/question/63917/sagemath-stopped-working-after-installing-ubuntu-2204/) , I change my way to install SageMath, using Linux Firefox instead of W11 Firefox . and then no kernel pb connection yet !.
moreover my W11 SageMath shortcut is also working ! ;-)
follow these steps:
in PowerShell cmd run as administrator:
install WSL2
wsl --install -d Ubuntu-22.04
restart the computer
launch Ubuntu apps an in the Ubuntu cmd shell :
1 sudo apt update
2 sudo apt upgrade
4 sudo apt-get install bc binutils bzip2 ca-certificates cliquer cmake curl ecl eclib-tools fflas-ffpack flintqs g++ gcc gengetopt gfan gfortran glpk-utils gmp-ecm lcalc libatomic-ops-dev libboost-dev libbraiding-dev libbrial-dev libbrial-groebner-dev libbz2-dev libcdd-dev libcdd-tools libcliquer-dev libcurl4-openssl-dev libec-dev libecm-dev libffi-dev libflint-arb-dev libflint-dev libfplll-dev libfreetype6-dev libgc-dev libgd-dev libgf2x-dev libgiac-dev libgivaro-dev libglpk-dev libgmp-dev libgsl-dev libhomfly-dev libiml-dev liblfunction-dev liblinbox-dev liblrcalc-dev liblzma-dev libm4ri-dev libm4rie-dev libmpc-dev libmpfi-dev libmpfr-dev libncurses5-dev libntl-dev libopenblas-dev libpari-dev libpcre3-dev libplanarity-dev libppl-dev libprimesieve-dev libpython3-dev libqhull-dev libreadline-dev librw-dev libsingular4-dev libsqlite3-dev libssl-dev libsuitesparse-dev libsymmetrica2-dev libz-dev libzmq3-dev libzn-poly-dev m4 make nauty ninja-build openssl palp pari-doc pari-elldata pari-galdata pari-galpol pari-gp2c pari-seadata patch perl pkg-config planarity ppl-dev python3 python3-distutils python3-venv r-base-dev r-cran-lattice singular singular-doc sqlite3 sympow tachyon tar tox xcas xz-utils
6 wget http://www.mirrorservice.org/sites/www.sagemath.org/src/sage-9.7.tar.gz
7 tar xvf sage-9.7.tar.gz
9 nano ~/.bashrc
#write this line in it
alias sage=~/sage-9.7/sage
10 source ~/.bashrc
11 cd sage-9.7
12 ./configure
13 sudo apt-get update
15 sudo apt-get upgrade
23 ./configure ./config.status --recheck && ./config.status
24 cd sage-9.7/
25 make -j32
26 nano sage_nb.sh
#write these 3 lines below and adapt to your user name
#!/bin/bash
cd '/mnt/c/Documents and Settings/user/Mes documents/IPYNBpc'
/home/ortollj/sage-9.7/sage --notebook jupyter
27 chmod ug+x sage_nb.sh
69 sudo apt install x11-apps
#test graphics app
70 xeyes &
71 xcalc
72 sudo apt install octave
73 octave --gui &
#quit all apps above
81 sudo snap install firefox
83 sudo apt-get update
84 sudo apt-get upgrade
# test
86 ./sage_nb.sh
I got errors in executing Julia script !, so test octave graphics simply with :
x = linspace(0,1,10)
y = x.^2
plot(x,y);
[install-ubuntu-on-wsl2-on-windows-11-with-gui-support](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support#2-install-wsl)
you can also use SageMath without using Jupyter notebook, the plots now work in Ubuntu WSL W11.
![plot with imageMagic](/upfiles/1676395068971719.jpg)ortolljTue, 31 Jan 2023 07:24:07 +0100https://ask.sagemath.org/question/66159/How to show PNG viewer from WSL with X server?https://ask.sagemath.org/question/65505/how-to-show-png-viewer-from-wsl-with-x-server/There is a similar question: Why is a png viewer not loading?(question/63924). The answer in that post only gave an alternative instead of answering the original question. I don't want to execute sagemath with Jupyter notebook. The first comment in that post asked the OP to install X server. I have install X server and I also can see the windows on my Windows when typing these commands from my WSL
```
xeyes
xclock -update 1
```
However, I still cannot see the PNG viewer when I execute this command in Sage.
```
show(plot(sin(x) + sin(1.6*x), 0, 40))
```
The command above was got from the tour of Sage. How can I show the PNG view in Windows with Sage installed in WSL?
## System Information
WSL version: WSL2
Windows: Windows 11
Ubuntu 20.04
Sage was installed by `sudo apt-get install sagemath`IvanaGyroSat, 24 Dec 2022 13:48:04 +0100https://ask.sagemath.org/question/65505/make PB when installing from sourcehttps://ask.sagemath.org/question/63362/make-pb-when-installing-from-source/ I tried to upgrade from SageMath 9.5 to 9.6 without success.
because the code below generate error with 9.5:TypeError: unable to find a common ring for all elements
@interact
def _(v=('vector', input_grid(1, 3, default=[[1,2,3]], to_value=lambda x: vector(flatten(x))))):
print(v.norm())
HI
WSL2,W11,Ubuntu 20.04
I wanted to keep the old version 9.5 which is in the sage directory,so
I renamed sage to sage-9.5 and then rename the sage-9.6 directory to sage.
the compilation time was much lower than usual, moreover the make does not signal an error.
I had thought that maybe it was because I was using make -j32 ,so the compilation takes 30 minutes which is suspicious
but I got the same PB with make alone which take 111 min only !.
real 111m46.476s
user 114m7.313s
sys 5m34.121s
Sage build/upgrade complete!
make[1]: Leaving directory '/home/ortollj/sage-9.6'
there are some messages in configure process
config.status: creating convenience symlink venv -> local/var/lib/sage/venv-python3.8
configure:
notice: the following SPKGs did not find equivalent system packages:
4ti2 coxeter3 gp2c igraph libsemigroups lrslib pari_elldata pari_galpol pari_nftables pari_seadata polymake _recommended
checking for the package system in use... debian
configure:
hint: installing the following system packages, if not
already present, may provide additional optional features:
$ sudo apt-get update
$ sudo apt-get install 4ti2 pari-gp2c libigraph-dev lrslib polymake libpolymake-dev default-jdk libavdevice-dev
configure:
hint: After installation, re-run configure using:
$ ./config.status --recheck && ./config.status
but when i run the recommended commands I got :0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ortolljSat, 23 Jul 2022 18:43:10 +0200https://ask.sagemath.org/question/63362/How to run a test file?https://ask.sagemath.org/question/63075/how-to-run-a-test-file/Hello, I'm trying to run a test file, test_nucomp_timing.py, that tests the functionality of another file in sage's source code. test_nucomp_timing.py itself is not in sage's source code, but the file I'm testing is. Where should I put the test file, and which command should I use in order to run it? So far what I've tried is putting the file in sage's src folder and running the command "./sage test_nucomp_timing.py", but the first line of the test file is "from sage.schemes.hyperelliptic_curves import jacobian_morphism", which produces this error:
Traceback (most recent call last):
File "/mnt/c/Users/Raine/sage/test_nucomp_timing.py", line 1, in <module>
from sage.schemes.hyperelliptic_curves import jacobian_morphism
File "/mnt/c/Users/Raine/sage/src/sage/schemes/hyperelliptic_curves/jacobian_morphism.py", line 119, in <module>
from sage.schemes.generic.morphism import SchemeMorphism
File "/mnt/c/Users/Raine/sage/src/sage/schemes/generic/morphism.py", line 84, in <module>
from sage.rings.fraction_field_element import FractionFieldElement
File "sage/rings/fraction_field_element.pyx", line 26, in init sage.rings.fraction_field_element
File "sage/rings/integer_ring.pyx", line 1, in init sage.rings.integer_ring
File "sage/rings/integer.pyx", line 1, in init sage.rings.integer
File "sage/rings/rational.pyx", line 79, in init sage.rings.rational
ImportError: cannot import name ZZ
Is there anything I haven't set up properly? Thank you!raineThu, 30 Jun 2022 21:57:27 +0200https://ask.sagemath.org/question/63075/SPKGs did not find equivalent system packages 9.4 WSL2https://ask.sagemath.org/question/59898/spkgs-did-not-find-equivalent-system-packages-94-wsl2/Hi
Trying to install 9.4 in WSL with sage-9.4-Ubuntu_20.04-x86_64.tar.bz2 :
[Install Sage Math from source on WSL](https://www.sandyscott.net/2020/12/02/install-sage-math-from-source-on-wsl/)
I got this message at the step 4) Start building :
config.status: creating directory local/var/lib/sage/installed
configure:
notice: the following SPKGs did not find equivalent system packages:
arb cddlib ecl eclib flint fplll gc giac lcalc libhomfly pari pari_galdata pari_seadata_small _recommended coxeter3 gp2c igraph libsemigroups lrslib pari_elldata pari_galpol pari_nftables pari_seadata
checking for the package system in use... debian
configure:
hint: installing the following system packages, if not
already present, is recommended and may avoid having to
build them (though some may have to be built anyway):
$ sudo apt-get update
$ sudo apt-get install libflint-arb-dev libcdd-dev libcdd-tools ecl libec-dev eclib-tools libflint-dev libgc-dev libgiac-dev xcas lcalc liblfunction-dev libhomfly-dev pari-gp2c libpari-dev pari-doc pari-elldata pari-galdata pari-galpol pari-seadata
configure:
hint: installing the following system packages, if not
already present, may provide additional optional features:
$ sudo apt-get update
$ sudo apt-get install texlive-latex-extra texlive-xetex latexmk dvipng default-jdk ffmpeg libavdevice-dev pari-gp2c libigraph-dev lrslib
configure:
hint: After installation, re-run configure using:
$ ./config.status --recheck && ./config.status
ortollj@DESKTOP-K30FLRP:~/sage-9.4$ sudo apt-get install libflint-arb-dev libcdd-dev libcdd-tools ecl libec-dev eclib-tools libflint-dev libgc-dev libgiac-dev xcas lcalc liblfunction-dev libhomfly-dev pari-gp2c libpari-dev pari-doc pari-elldata pari-galdata pari-galpol pari-seadata
[sudo] password for ortollj:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgc-dev is already the newest version (1:7.6.4-0.4ubuntu1).
ecl is already the newest version (16.1.3+ds-4).
eclib-tools is already the newest version (20190909-2build2).
lcalc is already the newest version (1.23+dfsg-11build1).
libcdd-dev is already the newest version (094j-2).
libcdd-tools is already the newest version (094j-2).
libec-dev is already the newest version (20190909-2build2).
libflint-arb-dev is already the newest version (1:2.17.0-1).
libflint-dev is already the newest version (2.5.2-21build1).
libgiac-dev is already the newest version (1.5.0.85+dfsg1-3).
libhomfly-dev is already the newest version (1.02r5-1).
liblfunction-dev is already the newest version (1.23+dfsg-11build1).
libpari-dev is already the newest version (2.11.2-2).
pari-doc is already the newest version (2.11.2-2).
pari-elldata is already the newest version (0.20190911-1).
pari-galdata is already the newest version (0.20080411-2).
pari-galpol is already the newest version (4.0-1).
pari-gp2c is already the newest version (0.0.11pl2-3).
pari-seadata is already the newest version (0.20090618-1).
xcas is already the newest version (1.5.0.85+dfsg1-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ortollj@DESKTOP-K30FLRP:~/sage-9.4$ sudo apt-get install texlive-latex-extra texlive-xetex latexmk dvipng default-jdk ffmpeg libavdevice-dev pari-gp2c libigraph-dev lrslib
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libigraph0-dev' instead of 'libigraph-dev'
default-jdk is already the newest version (2:1.11-72).
dvipng is already the newest version (1.15-1.1).
latexmk is already the newest version (1:4.67-0.1).
libigraph0-dev is already the newest version (0.7.1-4build1).
lrslib is already the newest version (0.70-3).
pari-gp2c is already the newest version (0.0.11pl2-3).
texlive-latex-extra is already the newest version (2019.202000218-1).
texlive-xetex is already the newest version (2019.20200218-1).
ffmpeg is already the newest version (7:4.2.4-1ubuntu0.1).
libavdevice-dev is already the newest version (7:4.2.4-1ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.ortolljTue, 23 Nov 2021 08:24:12 +0100https://ask.sagemath.org/question/59898/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/