Three 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 .

**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

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

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!

The command

does not seem to work:

Try with

`python=3.10`

?The exact same result, alas (including references to .../lib/python3.9/...)