conda sage

629 views
Skip to first unread message

William Stein

unread,
Mar 10, 2024, 3:36:47 PM3/10/24
to sage-devel
Hi,

I just tried installing sage via conda and it's broken.   Am I doing something wrong, or is there any automated testing of sage in conda (which might be a good thing to have)?  I was going to publicize sage+conda in a post I was about to make, but won't...

1. Install mambaforge into Ubuntu
2. Add conda-forge channel
3. Install the "sage" package.
4. It appears to install but is broken, evidently maybe due to a libgsl dependency (not sure):

user@compute-server-1540:anaconda$ sage -sh
...
(sage-sh) user@compute-server-1540:anaconda$ python
Python 3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:40:35) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/conda/envs/default/lib/python3.11/site-packages/sage/all.py", line 75, in <module>
    from sage.misc.all       import *         # takes a while
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/conda/envs/default/lib/python3.11/site-packages/sage/misc/all.py", line 62, in <module>
    from .functional import (additive_order,
  File "/conda/envs/default/lib/python3.11/site-packages/sage/misc/functional.py", line 26, in <module>
    from sage.rings.complex_double import CDF
ImportError: libgsl.so.25: cannot open shared object file: No such file or directory
>>>
sage:                                                                                                
(compute-server-1540) ~/anaconda$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.1, Release Date: 2023-08-20                    │
│ Using Python 3.11.6. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: sage.all is not available; this is a limited REPL.        ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: factor(2024)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 factor(Integer(2024))

NameError: name 'factor' is not defined
sage:                                   

 

William

--

Matthias Koeppe

unread,
Mar 10, 2024, 4:39:29 PM3/10/24
to sage-devel
William, do the instructions in our Installation Guide work for you?

Note in particular this step: "Change channel priority to strict: conda config --set channel_priority strict"

William Stein

unread,
Mar 10, 2024, 4:48:15 PM3/10/24
to sage-...@googlegroups.com
On Sun, Mar 10, 2024 at 1:39 PM Matthias Koeppe <matthia...@gmail.com> wrote:
William, do the instructions in our Installation Guide work for you?

Note in particular this step: "Change channel priority to strict: conda config --set channel_priority strict"

I'm using micromamba, which is supposed to be a drop in replacement for conda, but it just gives an error for the above, so maybe it is missing critical features needed to install sage:

---

(compute-server-1540) ~/anaconda$ micromamba config --set channel_priority strict
The following arguments were not expected: strict channel_priority --set
Run with --help for more information.

---

I'll revisit whether I need to switch to another conda...

That said micromamba has strict by default:  https://github.com/mamba-org/provision-with-micromamba/issues/33

(compute-server-1540) ~/anaconda$ micromamba config --set channel_priority strict --help
Configuration of micromamba
Usage: /usr/local/bin/micromamba config [OPTIONS] [SUBCOMMAND]

Options:
  -h,--help                   Print this help message and exit


Configuration options:
  --rc-file TEXT ...          Paths to the configuration files to use
  --no-rc                     Disable the use of configuration files
  --no-env                    Disable the use of environment variables


Global options:
  -v,--verbose                Set verbosity (higher verbosity with multiple -v, e.g. -vvv)
  --log-level ENUM:value in {critical->5,debug->1,error->4,info->2,off->6,trace->0,warning->3} OR {5,1,4,2,6,0,3}
                              Set the log level
  -q,--quiet                  Set quiet mode (print less output)
  -y,--yes                    Automatically answer yes on prompted questions
  --json                      Report all output as json
  --offline                   Force use cached repodata
  --dry-run                   Only display what would have been done
  --download-only             Only download and extract packages, do not link them into environment.
  --experimental              Enable experimental features


Prefix options:
  -r,--root-prefix TEXT       Path to the root prefix
  -p,--prefix TEXT            Path to the target prefix
  --relocate-prefix TEXT      Path to the relocation prefix
  -n,--name TEXT              Name of the target prefix

Subcommands:
  list                        List configuration values
  sources                     Show configuration sources
  describe                    Describe given configuration parameters
  prepend                     Add one configuration value to the beginning of a list key
  append                      Add one configuration value to the end of a list key
  remove-key                  Remove a configuration key and its values
  remove                      Remove a configuration value from a list key. This removes all instances of the value.
  set                         Set a configuration value
  get                         Get a configuration value
 
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/2fa5b435-2aa8-4303-8c13-048660e19380n%40googlegroups.com.


--

Matthias Koeppe

unread,
Mar 10, 2024, 5:04:57 PM3/10/24
to sage-devel
I suppose you can try instead using the switch "--rc-file" with the rc-file provided by Sage in https://github.com/sagemath/sage/blob/develop/condarc.yml

William Stein

unread,
Mar 10, 2024, 7:05:54 PM3/10/24
to sage-...@googlegroups.com
Hi,

So I was using MicroMamba, whereas that page says Sage only supports Mambaforge, Miniforge, Miniconda or Anaconda.    I tried with Mambaforge (as recommended there) and everything works perfectly, with sage-10.2 being available, and nicely integrated with the conda ecosystem, and also it's easy to switch Python versions.  So I'll switch from using MicroMamba to Mambaforge.  Problem solved. 

William
--

William Stein

unread,
Mar 10, 2024, 8:31:56 PM3/10/24
to sage-...@googlegroups.com
I was just carefully reading the page about Mambaforge linked to from Sage, i.e., this page


and it says that Mambaforge is deprecated and no longer recommended, and instead people should install Miniforge, i.e., "(Discouraged as of September 2023)".  We should update the instructions at 


since they recommend the now discouraged Mambaforge.

The page https://github.com/conda-forge/miniforge suggests that Mambaforge is somehow "just as good", but when I tried doing clean installs, then installing Sage, I had the best experience (i.e., completely perfect!) with Miniforge, which is what they recommend.  Basically, we should instead recommend:

sh Miniforge3-$(uname)-$(uname -m).sh -b -u -p /conda

-- William
--

William Stein

unread,
Mar 10, 2024, 8:37:23 PM3/10/24
to sage-...@googlegroups.com
Minor correction -- they say "Given its wide usage, there are no plans to deprecate Mambaforge."  So Mambaforge isn't deprecated as I incorrectly wrote.  It's just "discouraged".

I'm sorry for the noise, but the *conda* packaging ecosystem makes me dizzy...
--

Isuru Fernando

unread,
Mar 13, 2024, 12:11:52 PM3/13/24
to sage-...@googlegroups.com
Hi William,

Let me know if you have any questions regarding conda installation of sage.
It'd be great to have more visibility towards conda installation to attract more
users and developers in particular who can help out.

Thanks,
Isuru

William Stein

unread,
Mar 13, 2024, 12:41:19 PM3/13/24
to sage-...@googlegroups.com
With switching to Miniforge it is now working for me extremely well.  I’m going to be making a new video and tutorial about this soon.  Thanks for all you do Isuru!

-- William Stein


C B

unread,
Mar 22, 2024, 1:39:55 PM3/22/24
to sage-devel
Sage in conda-forge is still 10.2
Reply all
Reply to author
Forward
0 new messages