Ask Your Question
0

Where is my sage?

asked 2023-06-11 12:08:04 +0200

licheng gravatar image

updated 2023-06-11 12:33:09 +0200

My computer is Windows-based, so I used WSL (Ubuntu 22.04) to compile Sage 10.0 from source code. I followed the instructions from the link below. It took me approximately 5 hours.

image description

It indicates that the installation was successful.

However, it can only run sage within the Sage directory.

So I executed the following command, but after executing it, I can no longer find the Sage directory.

sudo ln -sf $(pwd)/sage /usr/local/bin

I don't know what happened. I reopened WSL and I don't know where to find my Sage again. The Sage directory is missing!

image description

image description

How can I find my Sage installation directory again and run it? It would be frustrating to recompile it again.

edit retag flag offensive close merge delete

Comments

A possible solutions is to set up SAGE_ROOT variable like:

export SAGE_ROOT=/home/user/sage/sage

Max Alekseyev gravatar imageMax Alekseyev ( 2023-06-11 14:24:00 +0200 )edit

@Max Alekseyev It gives me that -bash: export:=': not a valid identifier -bash: export: /home/user/sage/sage': not a valid identifier

licheng gravatar imagelicheng ( 2023-06-11 14:37:26 +0200 )edit

Indeed, I'm not quite sure how to find my Sage executable file. I can't even find sage/sage directory. I assure you I haven't done anything other than running the command sudo ln -sf $(pwd)/sage /usr/local/bin in that link. The Sage directory is missing ( was deleted or hidden?)

licheng gravatar imagelicheng ( 2023-06-11 14:42:28 +0200 )edit

My bad - there should be no spaces around =:

export SAGE_ROOT=/home/user/sage/sage

Max Alekseyev gravatar imageMax Alekseyev ( 2023-06-11 14:50:33 +0200 )edit

Your screenshot shows that sage/sage directory is located in the home directory of user zlc.

Max Alekseyev gravatar imageMax Alekseyev ( 2023-06-11 14:52:52 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-11 23:54:02 +0200

slelievre gravatar image

In the Ubuntu installed under WSL, installing from Conda should be a lot faster.

First, install Mambaforge:

$ FORGE=https://github.com/conda-forge/miniforge/releases/latest/download
$ INSTALLER=Mambaforge-$(uname)-$(uname -m).sh
$ curl -L -O $FORGE/$INSTALLER
$ sh $INSTALLER

This starts an installation scripts which guides you in installing Mambaforge. Follow the script's instructions, which sometimes involve typing "yes", or hitting Enter, etc. (if in doubt, use the suggested defaults).

Once this is done, the last few lines tell you to open a new terminal.

In that new terminal, if the conda base environment gets auto-activated, and that annoys you, run

$ conda config --set auto_activate_base false

and open yet another terminal to see that taken into account.

In that new terminal, type one of the following:

$ mamba create -n sage sage jupyterlab

Mamba will solve the constraints for installing the requested software, and propose a choice of package versions. Accept it and let it install.

Done installing.

To use your new installation, in any new terminal window, activate the sage conda environment:

$ conda activate sage

then run one of:

$ sage  # to use the Sage REPL
$ jupyter lab  # to use Sage in Jupyter

Happy computing!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-06-11 12:08:04 +0200

Seen: 336 times

Last updated: Jun 11 '23