> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Labels

export const Comments = ({children}) => {
  return <div class="my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10" data-callout-type="comments">
      <div class="w-4">
        <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" aria-label="Comments">
            <path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM280 400C266.7 400 256 410.7 256 424C256 437.3 266.7 448 280 448L360 448C373.3 448 384 437.3 384 424C384 410.7 373.3 400 360 400L352 400L352 312C352 298.7 341.3 288 328 288L280 288C266.7 288 256 298.7 256 312C256 325.3 266.7 336 280 336L304 336L304 400L280 400zM320 256C337.7 256 352 241.7 352 224C352 206.3 337.7 192 320 192C302.3 192 288 206.3 288 224C288 241.7 302.3 256 320 256z" />
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

<Tooltip tip="Part of the URLs on Anaconda.org where conda looks for packages.">Labels</Tooltip> on Anaconda.org help you organize packages and control their visibility. By applying labels to packages, you can facilitate the development cycle—separating development, testing, and production code—without impacting users who only want stable releases. Using Anaconda Client, package developers can create labels like `dev` for development, `test` for testing, or `rc` for release candidates.

## Understanding labels

By default, conda only finds packages labeled `main`. If you don't specify a label when uploading, your package automatically gets the `main` label. However, you can use other labels such as `dev`, `test`, or `any-custom-label` to effectively "hide" a package or package version from conda's default search and install behavior. Users can still access the labeled package on Anaconda.org but must explicitly specify the label to find and install the package with conda.

<Warning>
  Anaconda.org web URLs use `/labels` (plural) while conda commands use `/label` (singular).
</Warning>

The following examples use a <Tooltip tip="Each user and organization has their own location called a 'namespace' where they can host packages. You can view the public packages in a user or organization's namespace by navigating to their user page.">Namespace</Tooltip> of `travis`:

| Web Interface                     | Conda Command                                         | What it contains                     |
| :-------------------------------- | :---------------------------------------------------- | :----------------------------------- |
| `anaconda.org/travis`             | `conda install --channel travis <PACKAGE>`            | Default packages (`main` label only) |
| `anaconda.org/travis/labels/main` | `conda install --channel travis/label/main <PACKAGE>` | Explicitly accessing `main` label    |
| `anaconda.org/travis/labels/dev`  | `conda install --channel travis/label/dev <PACKAGE>`  | Development packages                 |
| `anaconda.org/travis/labels/test` | `conda install --channel travis/label/test <PACKAGE>` | Testing packages                     |

## Using labels to control package visibility

The following steps explain how to apply a `test` label, which allows you to upload files without affecting your production-quality packages, then how to apply the `main` label to make it visible to conda.

### Building and uploading the package

Use [Anaconda Prompt](/reference/glossary#anaconda-prompt) (Terminal on macOS/Linux) to perform the following steps:

1. Start with a <Tooltip tip="An archive file containing a software program and all its dependencies for easy installation. Conda automatically handles dependency tracking across different platforms, eliminating the need to manually install each component separately.">conda package</Tooltip>. In this example, we use a small public [conda test package](https://github.com/Anaconda-Platform/anaconda-client/tree/master/example-packages/conda):

   ```sh theme={null}
   git clone https://github.com/Anaconda-Platform/anaconda-client/
   cd anaconda-client/example-packages/conda/
   ```

2. Open the `meta.yaml` file by running the following command:

   ```sh theme={null}
   nano meta.yaml
   ```

3. Change the version number to `2.0`. To save and close the `meta.yaml` file, press Ctrl+X, followed by Y.

4. To build the package, turn off automatic Client uploading and then run the `conda build` command:

   ```sh theme={null}
   conda config --set anaconda_upload no
   conda build .
   ```

   <Tip>
     You can check where the resulting file was placed by adding the `--output` option:

     ```sh theme={null}
     conda build . --output
     ```
   </Tip>

5. Upload your test package to Anaconda.org using the Anaconda Client upload command.

   Add the `--label` option followed by your label (in this case, `test`), which tells Anaconda.org to make the upload visible only to users who specify that label:

   ```sh theme={null}
   anaconda upload </PATH/TO/PACKAGE_NAME>.tar.bz2 --label test
   ```

   <Comments>
     Replace \</PATH/TO/PACKAGE\_NAME> with the correct file path and package name.
   </Comments>

Now you can see that even when you search conda `main`, you do not see the `2.0` version of the test package. This is because you need to tell conda to look for your new `test` label.

### Testing the discoverability of the package

1. Add the `--override` argument, which tells conda not to use any <Tooltip tip="A location (URL or file path) in a repository where conda looks for packages.">channels</Tooltip> in your `~/.condarc` file. Without specifying the label and package name, the `2.0` version is not discoverable:

   ```sh theme={null}
   conda search --override --channel <USERNAME> conda-package
   ```

   <Comments>
     Replace \<USERNAME> with your username.
   </Comments>

   Once the label and package are specified, the `2.0` can be found:

   ```sh theme={null}
   conda search --override --channel <USERNAME>/label/test conda-package
   ```

   <Comments>
     Replace \<USERNAME> with your username.
   </Comments>

2. You can give the label `<USERNAME>/label/test` to your testers, where `<USERNAME>` is your username.

3. Once they finish testing, you may then want to copy the `test` packages back to your `main` label:

   ```sh theme={null}
   anaconda label --copy test main
   ```

   You can also manage your package labels from your dashboard at `https://anaconda.org/USERNAME/conda-package`, where `<USERNAME>` is your username.

   Your version `2.0` is now in `main`:

   ```sh theme={null}
   conda search --override --channel <USERNAME> conda-package
   ```

   <Comments>
     Replace \<USERNAME> with your username.
   </Comments>

If you use `anaconda-client` 1.7 or higher, you can use `anaconda move` to move packages from one label to another:

<CodeGroup>
  ```sh anaconda move theme={null}
  anaconda move --from-label <OLD> --to-label <NEW> <SPEC>
  ```

  ```sh Examples theme={null}
  # Move an entire set of files to a new label
  anaconda move --from-label main --to-label dev myusername/numpy/1.21.0
  # Move a single file to a new label
  anaconda move --from-label main --to-label dev myusername/numpy/1.21.0/numpy-1.21.0-py39_0.conda
  ```
</CodeGroup>

<Comments>
  Replace \<OLD> with the old label.<br />
  Replace \<NEW> with the new label. <br />
  Replace \<SPEC> with the package file path to move.
</Comments>
