Skip to content

Commit

Permalink
Installation: Add libmamba solver to conda Note (napari#110)
Browse files Browse the repository at this point in the history
# Description

Add mention of using regular conda but with the `libmamba` solver, as a
way to resolve installation issues. See
https://conda.github.io/conda-libmamba-solver/libmamba-vs-classic/
Currently, we suggest mamba. This works well, but breaks copy-paste of
`conda install ...` and other instructions. Changing the solver gives
much of the benefit, without needing to change the command.
See discussion at: napari/napari#5509
 

## Type of change
- [x] Fixes or improves existing content

# References
closes napari#96

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
  • Loading branch information
2 people authored and melissawm committed Mar 28, 2023
1 parent 2e89d61 commit 3afbe53
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
8 changes: 7 additions & 1 deletion docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{% extends "!layout.html" %}
{% block extrahead %}
<script async defer data-domain="napari.org" src="https://plausible.io/js/plausible.js"></script>
{{ super() }}
{% endblock %}

{% block document %}
<p>PAGENAME: <p>
{% endblock %}


{{ super() }}
11 changes: 11 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@
"conda_create_env": f"```sh\nconda create -y -n napari-env -c conda-forge python={python_version}\nconda activate napari-env\n```",
}

# def linkify_prs(input):
# prs = re.compile("#(?P<id>[0-9]+)")
# return re.sub(prs, "https://github.com/napari/napari/issues/%(id)s", input)

# linkifyers = {
# "(?P<id>[0-9a-f]{7,40})": "https://github.com/napari/napari/commit/%(id)s",
# "(?P<org>[a-zA-Z0-9_-]+)/(?P<repo>[a-zA-Z0-9_-]+)#(?P<id>[0-9]+)": "https://github.com/%(org)s/%(repo)s/issues/%(id)s",
# }
# Is it possible to define pure substitutions with #N instead of {{ #N }}?

nb_output_stderr = 'show'

panels_add_bootstrap_css = False
Expand Down Expand Up @@ -236,6 +246,7 @@ def setup(app):
"""
app.registry.source_suffix.pop(".ipynb", None)
app.connect('linkcheck-process-uri', rewrite_github_anchor)
#app.connect('release-notes-links', release_notes_links)


def get_attributes(item, obj, modulename):
Expand Down
29 changes: 21 additions & 8 deletions docs/tutorials/fundamentals/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,27 @@ conda install -c conda-forge "napari=*=*pyside2"
In some cases, `conda`'s default solver can struggle to find out which packages need to be
installed for napari. If it takes too long or you get the wrong version of napari
(see below), consider:
1. Overriding your default channels to use only `conda-forge` by adding `--override-channels`
and specifying the napari and Python versions explicitly. For example, use {{ python_version_code }}
to get Python {{ python_version }} and {{ napari_conda_version }} to specify the napari version as
{{ napari_version }}, the current release.
2. You can try installing [`mamba`](https://github.com/mamba-org/mamba) in your base
environment with `conda install -n base -c conda-forge mamba` and use its faster solver
by replacing `conda` for `mamba` in the above instructions.
1. Overriding your default channels to use only `conda-forge` by adding
`--override-channels` and specifying the napari and Python versions explicitly.
For example, use {{ python_version_code }} to get Python {{ python_version }} and
{{ napari_conda_version }} to specify the napari version as {{ napari_version }},
the current release.
2. Switching to the new, faster [`libmamba` solver](https://conda.github.io/conda-libmamba-solver/libmamba-vs-classic/),
by updating your `conda` (>22.11), if needed, and then installing and activating
the solver, as follows:
```
conda update -n base conda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
```
3. Alternately, consider installing [`mamba`](https://github.com/mamba-org/mamba)
in your base environment with `conda install -n base -c conda-forge mamba`.
Then you can use `mamba` by replacing `conda` with `mamba` in the installation instructions, for example:
```
mamba install napari
```
````


Expand Down

0 comments on commit 3afbe53

Please sign in to comment.