@@ -104,6 +104,39 @@ To maximize compatibility, we recommend putting ``conda-forge`` above ``defaults
104
104
.. _Anaconda Terms of Service : https://www.anaconda.com/terms-of-service
105
105
.. _the relevant conda docs : https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html?highlight=nodefaults#creating-an-environment-file-manually
106
106
107
+ Making builds faster with mamba
108
+ -------------------------------
109
+
110
+ One important thing to note is that, when enabling the ``conda-forge `` channel,
111
+ the conda dependency solver requires a large amount of RAM and long solve times.
112
+ This is `a known issue `_ due to the sheer amount of packages available in conda-forge.
113
+
114
+ As an alternative, you can instruct Read the Docs to use mamba _,
115
+ a drop-in replacement for conda that is much faster
116
+ and reduces the memory consumption of the dependency solving process.
117
+
118
+ To do that, add a ``.readthedocs.yaml `` :doc: `configuration file </config-file/v2 >`
119
+ with these contents:
120
+
121
+ .. code-block :: yaml
122
+ :caption : .readthedocs.yaml
123
+
124
+ version : 2
125
+
126
+ build :
127
+ os : " ubuntu-20.04"
128
+ tools :
129
+ python : " mambaforge-4.10"
130
+
131
+ conda :
132
+ environment : environment.yml
133
+
134
+ You can read more about the :ref: `config-file/v2:build.tools.python ` configuration
135
+ in our documentation.
136
+
137
+ .. _mamba : https://quantstack.net/mamba.html
138
+ .. _a known issue : https://www.anaconda.com/understanding-and-improving-condas-performance/
139
+
107
140
Mixing conda and pip packages
108
141
-----------------------------
109
142
@@ -168,23 +201,19 @@ For example, this conda environment contains the required dependencies to compil
168
201
Troubleshooting
169
202
---------------
170
203
171
- As explained in our
172
- :ref: `guide about build resources <guides/build-using-too-many-resources:Use pip when possible >`,
173
- ``conda `` is known to `require too much memory `_ when solving the satisfiability problem
174
- for the specified dependencies. There are some conda-specific tips to consider to
175
- minimize the running time or the memory usage:
204
+ If you have problems on the environment creation phase,
205
+ either because the build runs out of memory or time
206
+ or because some conflicts are found,
207
+ you can try some of these mitigations:
176
208
177
209
- Reduce the number of channels in ``environment.yml ``, even leaving ``conda-forge `` only
178
210
and opting out of the defaults adding ``nodefaults ``.
179
211
- Constrain the package versions as much as possible to reduce the solution space.
180
- - Use mamba _, an alternative package manager fully compatible with conda packages ,
181
- by requesting the `` CONDA_USES_MAMBA `` :ref: ` feature flag < feature-flags:Feature Flags >` .
212
+ - :ref: ` Use mamba < guides/conda:Making builds faster with mamba >` ,
213
+ an alternative package manager fully compatible with conda packages .
182
214
- And, if all else fails,
183
215
:ref: `request more resources <guides/build-using-too-many-resources:Requests more resources >`.
184
216
185
- .. _require too much memory : https://github.com/conda/conda/issues/5003
186
- .. _mamba : https://mamba.readthedocs.io/en/latest/
187
-
188
217
Custom Installs
189
218
---------------
190
219
0 commit comments