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.Thu, 25 May 2023 16:35:45 +0200How to upgrade sagemath from 9.6 to 9.8 using mamba?https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/In the [documentation](https://doc.sagemath.org/html/en/installation/conda.html), it is explained how to install sage using mamba with the line:
mamba create -n sage sage python=3.9
This line was run few months ago to installed sagemath 9.6 on the computer (MacBookAir) of my colleague Pascal.
What line should be run now to upgrade the installation from 9.6 to the most recent version 9.8?Thu, 11 May 2023 11:44:03 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/Comment by Pascal Weil for <p>In the <a href="https://doc.sagemath.org/html/en/installation/conda.html">documentation</a>, it is explained how to install sage using mamba with the line:</p>
<pre><code>mamba create -n sage sage python=3.9
</code></pre>
<p>This line was run few months ago to installed sagemath 9.6 on the computer (MacBookAir) of my colleague Pascal.</p>
<p>What line should be run now to upgrade the installation from 9.6 to the most recent version 9.8?</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68463#post-id-68463The exact same result, alas (including references to .../lib/python3.9/...)Tue, 16 May 2023 10:33:51 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68463#post-id-68463Comment by slelievre for <p>In the <a href="https://doc.sagemath.org/html/en/installation/conda.html">documentation</a>, it is explained how to install sage using mamba with the line:</p>
<pre><code>mamba create -n sage sage python=3.9
</code></pre>
<p>This line was run few months ago to installed sagemath 9.6 on the computer (MacBookAir) of my colleague Pascal.</p>
<p>What line should be run now to upgrade the installation from 9.6 to the most recent version 9.8?</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68460#post-id-68460Try with `python=3.10`?Tue, 16 May 2023 07:00:58 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68460#post-id-68460Comment by Sébastien for <p>In the <a href="https://doc.sagemath.org/html/en/installation/conda.html">documentation</a>, it is explained how to install sage using mamba with the line:</p>
<pre><code>mamba create -n sage sage python=3.9
</code></pre>
<p>This line was run few months ago to installed sagemath 9.6 on the computer (MacBookAir) of my colleague Pascal.</p>
<p>What line should be run now to upgrade the installation from 9.6 to the most recent version 9.8?</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68349#post-id-68349The command
mamba create -n sage sage=9.8 python=3.9
does not seem to work:
Traceback (most recent call last):
File "/Users/pascalweil/sagemath-forge/bin/mamba", line 7, in <module>
from mamba.mamba import main
File "/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/mamba/mamba.py", line 49, in <module>
import libmambapy as api
File "/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/__init__.py", line 7, in <module>
raise e
File "/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/__init__.py", line 4, in <module>
from libmambapy.bindings import * # noqa: F401,F403
ImportError: dlopen(/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/bindings.cpThu, 11 May 2023 16:02:34 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68349#post-id-68349Answer by Pascal Weil for <p>In the <a href="https://doc.sagemath.org/html/en/installation/conda.html">documentation</a>, it is explained how to install sage using mamba with the line:</p>
<pre><code>mamba create -n sage sage python=3.9
</code></pre>
<p>This line was run few months ago to installed sagemath 9.6 on the computer (MacBookAir) of my colleague Pascal.</p>
<p>What line should be run now to upgrade the installation from 9.6 to the most recent version 9.8?</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?answer=68375#post-id-68375Alas, something is the matter.
$ conda activate sage
works fine, but not
$ mamba upgrade sage
, see below. Some libarchive is missing.
(sage) pascalweil@MacBook-Air-2022-PW ~ % conda activate sage
(sage) pascalweil@MacBook-Air-2022-PW ~ % mamba upgrade sage
Traceback (most recent call last):
File "/Users/pascalweil/sagemath-forge/bin/mamba", line 7, in <module>
from mamba.mamba import main
File "/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/mamba/mamba.py", line 49, in <module>
import libmambapy as api
File "/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/__init__.py", line 7, in <module>
raise e
File "/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/__init__.py", line 4, in <module>
from libmambapy.bindings import * # noqa: F401,F403
ImportError: dlopen(/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/bindings.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libarchive.13.dylib
Referenced from: <91CFAC3D-BB83-3877-9EEE-54AC5B013662> /Users/pascalweil/sagemath-forge/lib/libmamba.2.0.0.dylib
Reason: tried: '/Users/pascalweil/sagemath-forge/lib/libarchive.13.dylib' (no such file), '/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/../../../libarchive.13.dylib' (no such file), '/Users/pascalweil/sagemath-forge/lib/python3.9/site-packages/libmambapy/../../../libarchive.13.dylib' (no such file), '/Users/pascalweil/sagemath-forge/bin/../lib/libarchive.13.dylib' (no such file), '/Users/pascalweil/sagemath-forge/bin/../lib/libarchive.13.dylib' (no such file), '/usr/local/lib/libarchive.13.dylib' (no such file), '/usr/lib/libarchive.13.dylib' (no such file, not in dyld cache)Fri, 12 May 2023 11:58:03 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?answer=68375#post-id-68375Answer by slelievre for <p>In the <a href="https://doc.sagemath.org/html/en/installation/conda.html">documentation</a>, it is explained how to install sage using mamba with the line:</p>
<pre><code>mamba create -n sage sage python=3.9
</code></pre>
<p>This line was run few months ago to installed sagemath 9.6 on the computer (MacBookAir) of my colleague Pascal.</p>
<p>What line should be run now to upgrade the installation from 9.6 to the most recent version 9.8?</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?answer=68351#post-id-68351Three options:
- activate existing "sage" conda environment; upgrade relevant packages
- create new environment with other name; if it works well, remove old one
- completely remove existing conda installation; start afresh
Details below for each of these options.
**Upgade existing environment**
$ conda activate sage # or: mamba activate sage
$ mamba upgrade sage # or: mamba update sage
**Create new environment**
$ mamba create -n sage98 sage=9.8
To list existing conda environments:
$ conda env list
To rename a conda environment:
$ conda rename -n sage98 sage
which in fact creates a new environment and removes the old one,
see [Stack Overflow answer 42231765 ](https://stackoverflow.com/a/42231765).
**Reinstall conda**
This assumes you were only using conda for Sage and you don't mind reinstalling it completely.
(Check with `conda env list` if you have any other conda environments.)
The sagemath-forge distribution you installed might no longer be maintained.
Remove it:
$ rm -rf ~/sagemath-forge
$ rm -rf ~/.conda
Remove any conda traces from `~/.zshrc` (in your favourite text editor).
Reinstall, taking inspiration from the "Install from conda-forge" instructions at
- [SageMath installation guide: install from conda-forge](https://doc.sagemath.org/html/en/installation/conda.html)
First, install mambaforge:
$ curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh
$ sh Mambaforge-$(uname)-$(uname -m).sh
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 this new terminal window, 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 window to see that taken into account.
In this new terminal window, type one of the following, depending
whether you want a specific Python version or are happy with any.
$ mamba create -n sage sage=9.8
$ mamba create -n sage sage=9.8 python=3.11
$ mamba create -n sage sage=9.8 python=3.10
Mamba will solve the constraints for installing the requested software,
and propose a choice of package versions. Accept it and let it install.
Once that is done, I suggest installing a very recent version of JupyterLab
into the "sage" conda environment.
The latest versions, and what conda-forge label to use to get them, are listed at
- https://anaconda.org/conda-forge/jupyterlab/labels
As of May 20, 2023, one might want to install JupyterLab 4.0.0rc1 as follows:
$ conda activate sage
$ mamba install -c conda-forge/label/jupyterlab_rc jupyterlab=4.0.0rc1
Install any other things you might want (with the sage conda environment active).
For instance the pari_jupyter package:
$ mamba install -c conda-forge pari_jupyter
which will allow you to use Jupyter sheets using a PARI/GP kernel.
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!Thu, 11 May 2023 16:45:21 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?answer=68351#post-id-68351Comment by slelievre for <p>Three options:</p>
<ul>
<li>activate existing "sage" conda environment; upgrade relevant packages</li>
<li>create new environment with other name; if it works well, remove old one</li>
<li>completely remove existing conda installation; start afresh</li>
</ul>
<p>Details below for each of these options.</p>
<p><strong>Upgade existing environment</strong></p>
<pre><code>$ conda activate sage # or: mamba activate sage
$ mamba upgrade sage # or: mamba update sage
</code></pre>
<p><strong>Create new environment</strong></p>
<pre><code>$ mamba create -n sage98 sage=9.8
</code></pre>
<p>To list existing conda environments: </p>
<pre><code>$ conda env list
</code></pre>
<p>To rename a conda environment:</p>
<pre><code>$ conda rename -n sage98 sage
</code></pre>
<p>which in fact creates a new environment and removes the old one,
see <a href="https://stackoverflow.com/a/42231765">Stack Overflow answer 42231765 </a>.</p>
<p><strong>Reinstall conda</strong></p>
<p>This assumes you were only using conda for Sage and you don't mind reinstalling it completely.</p>
<p>(Check with <code>conda env list</code> if you have any other conda environments.)</p>
<p>The sagemath-forge distribution you installed might no longer be maintained.</p>
<p>Remove it:</p>
<pre><code>$ rm -rf ~/sagemath-forge
$ rm -rf ~/.conda
</code></pre>
<p>Remove any conda traces from <code>~/.zshrc</code> (in your favourite text editor).</p>
<p>Reinstall, taking inspiration from the "Install from conda-forge" instructions at</p>
<ul>
<li><a href="https://doc.sagemath.org/html/en/installation/conda.html">SageMath installation guide: install from conda-forge</a></li>
</ul>
<p>First, install mambaforge:</p>
<pre><code>$ curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh
$ sh Mambaforge-$(uname)-$(uname -m).sh
</code></pre>
<p>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).</p>
<p>Once this is done, the last few lines tell you to open a new terminal.</p>
<p>In this new terminal window, if the conda base environment gets auto-activated,
and that annoys you, run</p>
<pre><code>$ conda config --set auto_activate_base false
</code></pre>
<p>and open yet another terminal window to see that taken into account.</p>
<p>In this new terminal window, type one of the following, depending
whether you want a specific Python version or are happy with any.</p>
<pre><code>$ mamba create -n sage sage=9.8
$ mamba create -n sage sage=9.8 python=3.11
$ mamba create -n sage sage=9.8 python=3.10
</code></pre>
<p>Mamba will solve the constraints for installing the requested software,
and propose a choice of package versions. Accept it and let it install. </p>
<p>Once that is done, I suggest installing a very recent version of JupyterLab
into the "sage" conda environment.</p>
<p>The latest versions, and what conda-forge label to use to get them, are listed at</p>
<ul>
<li><a href="https://anaconda.org/conda-forge/jupyterlab/labels">https://anaconda.org/conda-forge/jupy...</a></li>
</ul>
<p>As of May 20, 2023, one might want to install JupyterLab 4.0.0rc1 as follows:</p>
<pre><code>$ conda activate sage
$ mamba install -c conda-forge/label/jupyterlab_rc jupyterlab=4.0.0rc1
</code></pre>
<p>Install any other things you might want (with the sage conda environment active).</p>
<p>For instance the pari_jupyter package:</p>
<pre><code>$ mamba install -c conda-forge pari_jupyter
</code></pre>
<p>which will allow you to use Jupyter sheets using a PARI/GP kernel.</p>
<p>Done installing.</p>
<p>To use your new installation, in any new terminal window, activate the sage conda environment:</p>
<pre><code>$ conda activate sage
</code></pre>
<p>then run one of:</p>
<pre><code>$ sage # to use the Sage REPL
$ jupyter lab # to use Sage in Jupyter
</code></pre>
<p>Happy computing!</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68729#post-id-68729Did reinstalling work?Thu, 25 May 2023 16:35:45 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68729#post-id-68729Comment by Pascal Weil for <p>Three options:</p>
<ul>
<li>activate existing "sage" conda environment; upgrade relevant packages</li>
<li>create new environment with other name; if it works well, remove old one</li>
<li>completely remove existing conda installation; start afresh</li>
</ul>
<p>Details below for each of these options.</p>
<p><strong>Upgade existing environment</strong></p>
<pre><code>$ conda activate sage # or: mamba activate sage
$ mamba upgrade sage # or: mamba update sage
</code></pre>
<p><strong>Create new environment</strong></p>
<pre><code>$ mamba create -n sage98 sage=9.8
</code></pre>
<p>To list existing conda environments: </p>
<pre><code>$ conda env list
</code></pre>
<p>To rename a conda environment:</p>
<pre><code>$ conda rename -n sage98 sage
</code></pre>
<p>which in fact creates a new environment and removes the old one,
see <a href="https://stackoverflow.com/a/42231765">Stack Overflow answer 42231765 </a>.</p>
<p><strong>Reinstall conda</strong></p>
<p>This assumes you were only using conda for Sage and you don't mind reinstalling it completely.</p>
<p>(Check with <code>conda env list</code> if you have any other conda environments.)</p>
<p>The sagemath-forge distribution you installed might no longer be maintained.</p>
<p>Remove it:</p>
<pre><code>$ rm -rf ~/sagemath-forge
$ rm -rf ~/.conda
</code></pre>
<p>Remove any conda traces from <code>~/.zshrc</code> (in your favourite text editor).</p>
<p>Reinstall, taking inspiration from the "Install from conda-forge" instructions at</p>
<ul>
<li><a href="https://doc.sagemath.org/html/en/installation/conda.html">SageMath installation guide: install from conda-forge</a></li>
</ul>
<p>First, install mambaforge:</p>
<pre><code>$ curl -L -O https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh
$ sh Mambaforge-$(uname)-$(uname -m).sh
</code></pre>
<p>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).</p>
<p>Once this is done, the last few lines tell you to open a new terminal.</p>
<p>In this new terminal window, if the conda base environment gets auto-activated,
and that annoys you, run</p>
<pre><code>$ conda config --set auto_activate_base false
</code></pre>
<p>and open yet another terminal window to see that taken into account.</p>
<p>In this new terminal window, type one of the following, depending
whether you want a specific Python version or are happy with any.</p>
<pre><code>$ mamba create -n sage sage=9.8
$ mamba create -n sage sage=9.8 python=3.11
$ mamba create -n sage sage=9.8 python=3.10
</code></pre>
<p>Mamba will solve the constraints for installing the requested software,
and propose a choice of package versions. Accept it and let it install. </p>
<p>Once that is done, I suggest installing a very recent version of JupyterLab
into the "sage" conda environment.</p>
<p>The latest versions, and what conda-forge label to use to get them, are listed at</p>
<ul>
<li><a href="https://anaconda.org/conda-forge/jupyterlab/labels">https://anaconda.org/conda-forge/jupy...</a></li>
</ul>
<p>As of May 20, 2023, one might want to install JupyterLab 4.0.0rc1 as follows:</p>
<pre><code>$ conda activate sage
$ mamba install -c conda-forge/label/jupyterlab_rc jupyterlab=4.0.0rc1
</code></pre>
<p>Install any other things you might want (with the sage conda environment active).</p>
<p>For instance the pari_jupyter package:</p>
<pre><code>$ mamba install -c conda-forge pari_jupyter
</code></pre>
<p>which will allow you to use Jupyter sheets using a PARI/GP kernel.</p>
<p>Done installing.</p>
<p>To use your new installation, in any new terminal window, activate the sage conda environment:</p>
<pre><code>$ conda activate sage
</code></pre>
<p>then run one of:</p>
<pre><code>$ sage # to use the Sage REPL
$ jupyter lab # to use Sage in Jupyter
</code></pre>
<p>Happy computing!</p>
https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68725#post-id-68725Thanks Samuel!Thu, 25 May 2023 16:24:46 +0200https://ask.sagemath.org/question/68344/how-to-upgrade-sagemath-from-96-to-98-using-mamba/?comment=68725#post-id-68725