Skip to content

Commit 53b5dbf

Browse files
KemingHegithub-actions[bot]
authored andcommitted
docs(src/assets/): update conda official documentation
1 parent 392699e commit 53b5dbf

File tree

3 files changed

+85
-10
lines changed

3 files changed

+85
-10
lines changed

src/assets/conda/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"source_repo": "conda/conda",
33
"docs_path": "docs",
4-
"updated_at": "2025-11-04T22:05:04Z",
5-
"commit_sha": "a971401092e0ab6c770d5ea985611fd001cfe974"
4+
"updated_at": "2025-11-11T22:05:38Z",
5+
"commit_sha": "0049f3a2eae767641bf8be5340f6e40572797197"
66
}

src/assets/conda/source/user-guide/configuration/settings.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,38 @@ or specify it on the command line with the ``--console`` option
649649
650650
conda info --console=colors
651651
652+
.. _override-virtual-packages:
653+
654+
``override_virtual_packages``: Set version or build variables for virtual packages
655+
----------------------------------------------------------------------------------
656+
657+
.. note::
658+
You can also use ``virtual_packages`` for this setting.
659+
660+
The ``override_virtual_packages`` setting is a dictionary that allows you set
661+
specific version or build overrides for virtual package installs.
662+
663+
Conda sets virtual package version and/or build numbers in three ways:
664+
665+
1. By passing an enviroment variable with the ``conda install`` command (highest priority)
666+
667+
For example: ``CONDA_OVERRIDE_CUDA="12.0" conda install -c conda-forge tensorflow``
668+
669+
1. The ``override_virtual_packages`` dictionary in the ``.condarc`` file
670+
671+
1. The variables set up in the virtual package's code (lowest priority)
672+
673+
For more information on virtual packages, see :ref:`Managing virtual packages <manage-virtual>`.
674+
675+
Your ``override_virtual_packages`` dictionary could look like the following:
676+
677+
.. code-block:: yaml
678+
679+
override_virtual_packages:
680+
cuda: "12.8"
681+
glbc: "2.17"
682+
osx: "11.0"
683+
archspec: "x86_64"
652684
653685
Conda-build configuration
654686
=========================

src/assets/conda/source/user-guide/tasks/manage-virtual.rst

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,54 @@ Overriding detected packages
7171
============================
7272

7373
For troubleshooting, it is possible to override virtual package detection
74-
using an environment variable. Supported variables include:
75-
76-
* ``CONDA_OVERRIDE_CUDA`` - CUDA version number or set to ``""`` for no CUDA
77-
detected.
78-
* ``CONDA_OVERRIDE_OSX`` - OSX version number or set to ``""`` for no OSX
79-
detected.
80-
* ``CONDA_OVERRIDE_GLIBC`` - GLIBC version number or set to ``""`` for no GLIBC.
81-
This only applies on Linux.
74+
using an environment variable or a setting in your ``.condarc`` file.
75+
76+
Environment variables
77+
---------------------
78+
79+
You can set environment variables when using a ``conda install`` command.
80+
This way of overriding has the highest priority, **but the override
81+
variable must be set every time a package requiring that override is installed**.
82+
83+
**Example**:
84+
85+
.. code-block::
86+
87+
CONDA_OVERRIDE_CUDA=12.8 conda install pytorch
88+
89+
Supported variables include:
90+
91+
.. csv-table::
92+
:header-rows: 1
93+
94+
Variable Name, Override Entity, Example
95+
``CONDA_OVERRIDE_ARCHSPEC``, Build Number, x86_64
96+
``CONDA_OVERRIDE_CUDA``, Version Number, 12.8
97+
``CONDA_OVERRIDE_GLIBC``, Version Number, 2.17
98+
``CONDA_OVERRIDE_LINUX``, Version Number, 5.15.0
99+
``CONDA_OVERRIDE_OSX``, Version Number, 11.0
100+
``CONDA_OVERRIDE_WIN``, Version Number, 10.0.22631
101+
102+
.. note::
103+
104+
For any custom virtual packages, the variable name is
105+
``CONDA_OVERRIDE_<NAME>`` and the override entity is the
106+
``override_entity`` variable value, either "version" or "build".
107+
108+
``.condarc`` setting
109+
--------------------
110+
111+
To avoid having to set any override variables every time you install a package,
112+
conda also offers the ability to set these overrides in your ``.condarc`` file.
113+
114+
.. code-block:: yaml
115+
116+
override_virtual_packages:
117+
archspec: "x86_64"
118+
cuda: "12.8"
119+
glibc: "2.17"
120+
osx: "11.0"
121+
mycustompackage: "1.2.3"
122+
123+
See :ref:`override-virtual-packages <override-virtual-packages>` for more information on
124+
the ``.condarc`` setting.

0 commit comments

Comments
 (0)