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

# Intro to conda workflows

export const LearnMore = ({children}) => {
  return <div class="callout my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-green bg-green dark:border-green dark:bg-green [&_[data-component-part='callout-icon']]:mt-px" data-callout-type="tip">
      <div class="mt-0.5 w-4" data-component-part="callout-icon">
        <svg width="12" height="12" viewBox="0 0 500 500" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="text-green dark:text-green w-3.5 h-auto" aria-label="LearnMore">
          <path fill-rule="evenodd" clip-rule="evenodd" d="M206.7-13c11.4-2.3 23.1-2.3 34.5 0L428.7 24.5C439.9 26.7 448 36.6 448 48s-8.1 21.3-19.3 23.5L352 86.9 352 148c0 68.5-55.5 124-124 124S104 216.5 104 148l0-59.5-56-11.2 0 66.7 15.7 78.6c.2 .9 .3 1.9 .3 2.9 0 8-6.5 14.6-14.6 14.6l-34.9 0c-8 0-14.6-6.5-14.6-14.6 0-1 .1-1.9 .3-2.9L16 144 16 70.6C6.5 67.3 0 58.3 0 48 0 36.6 8.1 26.7 19.3 24.5L206.7-13zM152 144l0 4c0 42 34 76 76 76s76-34 76-76l0-4-152 0zM139 307.9c8.2-1.8 16.7 .9 22.5 7l62.6 66.2 62.6-66.2c5.8-6.1 14.3-8.7 22.5-7 79.4 17 139 87.6 139 172.1l0 8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8c0-56.8-37.1-105.1-88.4-121.8L248 425.5 248 488c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-62.5-63.6-67.3C85.1 374.9 48 423.2 48 480l0 8c0 13.3-10.7 24-24 24S0 501.3 0 488l0-8c0-84.5 59.6-155.1 139-172.1z"></path>
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full" data-component-part="callout-content">
        <strong>Learn more</strong><br />
        {children}
      </div>
    </div>;
};

export const DefinitionDescription = ({children}) => <dd className="definition-description">{children}</dd>;

export const DefinitionTerm = ({children}) => <dt className="definition-term">{children}</dt>;

export const DefinitionList = ({children}) => <dl className="definition-list">{children}</dl>;

export const Beginner = ({children}) => {
  return <div class="callout my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border beginner-admonition dark:beginner-admonition" data-callout-type="beginner">
      <div class="mt-0.5 w-4">
        <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" aria-label="Beginner">
          <path d="M175.3 160C161.3 160 148.8 169.2 144.7 182.6L102.4 320L256 320C273.7 320 288 334.3 288 352L352 352C352 334.3 366.3 320 384 320L537.6 320L495.3 182.6C491.2 169.2 478.8 160 464.7 160L432 160C414.3 160 400 145.7 400 128C400 110.3 414.3 96 432 96L464.7 96C506.8 96 544.1 123.5 556.5 163.8L601.9 311.3C606 324.5 608 338.2 608 352L608 448C608 501 565 544 512 544L448 544C395 544 352 501 352 448L352 416L288 416L288 448C288 501 245 544 192 544L128 544C75 544 32 501 32 448L32 352C32 338.2 34.1 324.5 38.1 311.3L83.5 163.8C95.9 123.5 133.1 96 175.3 96L208 96C225.7 96 240 110.3 240 128C240 145.7 225.7 160 208 160L175.3 160zM96 384L96 448C96 465.7 110.3 480 128 480L192 480C209.7 480 224 465.7 224 448L224 384L96 384zM512 480C529.7 480 544 465.7 544 448L544 384L416 384L416 448C416 465.7 430.3 480 448 480L512 480z" />
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

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>;
};

export const CodeCopy = () => {
  return <span className="inline_icon">
        <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M14.25 5.25H7.25C6.14543 5.25 5.25 6.14543 5.25 7.25V14.25C5.25 15.3546 6.14543 16.25 7.25 16.25H14.25C15.3546 16.25 16.25 15.3546 16.25 14.25V7.25C16.25 6.14543 15.3546 5.25 14.25 5.25Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
            <path d="M2.80103 11.998L1.77203 5.07397C1.61003 3.98097 2.36403 2.96397 3.45603 2.80197L10.38 1.77297C11.313 1.63397 12.19 2.16297 12.528 3.00097" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
        </svg>
    </span>;
};

Welcome! If you're new to conda, you're in the right place. This tutorial walks through creating and using your first conda environment as part of a real Python workflow. You'll create an environment, install packages, and use that environment to run a small Python program.

<Beginner>
  **Purpose**: This tutorial teaches you the basics of creating and using conda environments for Python development.

  **Outcome**: You'll create a new environment, add packages using both conda and pip, and configure Visual Studio Code to use your environment. By the end, you'll have created a fun Python program (featuring an ASCII cow!) and learned how to set up environments for your own projects.

  **Audience**: Beginners new to environment management

  **Duration**: 20 minutes
</Beginner>

## Prerequisites and requirements

Before you begin, make sure you have an internet connection and the following software installed on your machine:

* Conda

  <Tip>
    Conda comes bundled with both [Anaconda Distribution](/getting-started/anaconda/main) and [Miniconda](/getting-started/miniconda/main). Pick whichever installer you prefer, as both will work identically for this tutorial. Not sure which to choose? See [Choosing between Anaconda Distribution and Miniconda](/getting-started/concepts/anaconda-or-miniconda) to compare the two.
  </Tip>

* [Visual Studio Code](https://code.visualstudio.com/download), also known as VS Code, a popular <Tooltip tip="An interactive development environment. A suite of software tools that combines everything a developer needs to write and test software.">IDE</Tooltip> from Microsoft

* [Microsoft's Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code

* Some familiarity with using a command line interface

  <Tip>
    New to using the command line? Review Mozilla's [command line crash course](https://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Environment_setup/Command_line) for an overview of how to use it.
  </Tip>

## Creating your project's conda environment

The conda installation process creates an environment called `base`, which is where conda itself is installed. However, when starting work on a new project, it's best practice to create a new environment. This keeps your environments maintainable and reproducible while also keeping your `base` environment stable.

Let's create a new environment called `hello-env` with Python 3.14 as the <Tooltip tip="The Python installation that will run your code.">interpreter</Tooltip>.

<Steps>
  <Step title="Open a shell application">
    Conda is a command line interface (CLI) tool, which means you'll use a shell application to run conda commands. For Windows users, you'll use an application called Anaconda Prompt, which comes installed with Anaconda Distribution and Miniconda. For macOS and Linux users, you'll use your system's Terminal application.

    <Tabs>
      <Tab title="Windows">
        To open Anaconda Prompt, type "Anaconda Prompt" in the Windows search bar, then select **Anaconda Prompt**.

        <Frame>
          <img src="https://mintcdn.com/anaconda-29683c67/aG2LtQCwack7eY6N/images/anaconda_prompt.png?fit=max&auto=format&n=aG2LtQCwack7eY6N&q=85&s=0de2ad7f8dc160cd1aaaa655c44d2fb4" alt="Windows desktop with Anaconda Prompt in the taskbar search field." width="3460" height="2164" data-path="images/anaconda_prompt.png" />
        </Frame>
      </Tab>

      <Tab title="macOS/Linux">
        Open Terminal:

        * On macOS, open Spotlight with Cmd + Spacebar, then search for "Terminal".
        * On Linux, press Ctrl + Alt + T or search for "Terminal" in your application menu.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Create a new environment">
    Use the <CodeCopy /> **copy** button to copy the following command, paste it into your shell application, and press Enter (Windows)/ Return (macOS/Linux) to run it:

    ```sh theme={null}
    conda create --name hello-env python=3.14
    ```

    <Comments>
      The `--name` flag sets the new environment's name.
    </Comments>
  </Step>

  <Step title="Activate your new environment">
    You'll need to activate your newly created environment before you can use it. Run the following command to activate `hello-env`:

    ```sh theme={null}
    conda activate hello-env
    ```

    Conda displays the currently active environment in your shell application beside the input line:

    <CodeGroup>
      ```sh Windows example theme={null}
      (hello-env) C:\Users\username>
      ```

      ```sh macOS/Linux example theme={null}
      (hello-env) ~ 
      ```
    </CodeGroup>

    Your new project's environment is now active!
  </Step>
</Steps>

<LearnMore>
  Review the following resources to learn more about the topics covered in this section, or continue on to the next section.

  * [What is an environment?](/getting-started/concepts/what-is-an-environment)
  * [Working with environments](/getting-started/working-with-conda/environments)
</LearnMore>

## Adding packages to your project's environment

Right now, your environment only has Python 3.14 and its dependencies installed. However, our project uses functionality that is not provided by the Python standard library, so we must install third-party packages to provide that functionality.

<Steps>
  <Step title="Add conda packages">
    We can find the additional conda packages that we need for our project on the conda-forge community channel.

    <Tip>
      Conda-forge is a community-maintained collection of conda packages. Conda-forge packages are open source and free to use.
    </Tip>

    Our project requires the `requests` and `emoji` packages. Install the packages and their dependencies:

    ```sh theme={null}
    conda install --channel conda-forge requests emoji 
    ```

    <Comments>
      The `--channel` flag tells conda to give the specified channel top priority for installing packages and their dependencies.
    </Comments>

    The `requests` and `emoji` Python packages are now available in your environment.
  </Step>

  <Step title="Add packages with pip">
    Our project still requires one last package. However, this package is only available from Python's package index (also known as PyPI) and must be installed using Python's package manager, pip. Pip is a dependency of Python, so it was installed when you created your environment with Python in it. You can use it directly in the `hello-env` environment.

    <Warning>
      Using conda and pip together requires care to avoid dependency conflicts. Install conda packages first, then use pip only for packages unavailable in conda channels. Review the [Installing pip packages](/getting-started/working-with-conda/packages/pip-install) page to understand how to safely use conda and pip together for your own projects.
    </Warning>

    Use pip to install `cowsay` from PyPI:

    ```sh theme={null}
    pip install cowsay 
    ```

    Your `hello-env` environment now includes Python 3.14, `requests`, `emoji`, `cowsay`, and all their dependencies.
  </Step>
</Steps>

<LearnMore>
  Review the following resources to learn more about the topics covered in this section, or continue on to the next section.

  * [What is a channel?](/getting-started/concepts/what-is-a-channel)
  * [Channel priority](/getting-started/concepts/what-is-a-channel#channel-priority)
  * [What is a package?](/getting-started/concepts/what-is-a-package)
  * [Installing conda packages](/getting-started/working-with-conda/packages/install-packages)
  * [Installing pip packages](/getting-started/working-with-conda/packages/pip-install)
  * [Conda-forge](https://conda-forge.org/)
</LearnMore>

## Using your project's environment in VS Code

<Steps>
  <Step title="Open VS Code">
    First, open VS Code and select **New File...** on the Welcome tab.

    Then, select **Python File** to create a new untitled Python file.

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/Q0l5wcbOQ1FeeM68/images/conda_tutorial_vscode_new_file.png?fit=max&auto=format&n=Q0l5wcbOQ1FeeM68&q=85&s=a32dc8aca77570adddc8e17dde815222" alt="VS Code welcome screen with the New File... and Python File options indicated with an arrow." width="3460" height="1606" data-path="images/conda_tutorial_vscode_new_file.png" />
    </Frame>

    Press Ctrl+S (Windows/ Linux) or Cmd+S (macOS) to open the **Save As...** dialogue and save your new file as `factual-cow.py`.
  </Step>

  <Step title="Set the interpreter">
    Next, select `hello-env` as the file's Python interpreter.

    <Tip>
      The Python interpreter is the Python installation that will run your code. By selecting `hello-env`, you're telling VS Code to use the Python from your new environment.
    </Tip>

    To set the interpreter, select the interpreter button in the bottom right corner, then select *Python 3.14.0 (hello-env)* from the dropdown:

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/Q0l5wcbOQ1FeeM68/images/conda_tutorial_interpreter.png?fit=max&auto=format&n=Q0l5wcbOQ1FeeM68&q=85&s=4942625a875bd667e752b73dbd1cb8d1" alt="Selecting the hello-env environment as the Python interpreter in VS Code." width="3456" height="1370" data-path="images/conda_tutorial_interpreter.png" />
    </Frame>

    <Note>
      If you open a VS Code terminal, your terminal might show `(base)`, even though your interpreter in the bottom right shows `Python 3.14.0 (hello-env)`. The Python interpreter and the terminal are separate: the interpreter runs your .py files, while the terminal is for running commands. If you want to run conda commands from the VS Code terminal (for example, to add packages to your environment), activate the `hello-env` environment by running the following command in the VS Code terminal: `conda activate hello-env`.

      <Frame>
        <img src="https://mintcdn.com/anaconda-29683c67/Q0l5wcbOQ1FeeM68/images/conda_tutorial_activate_env.png?fit=max&auto=format&n=Q0l5wcbOQ1FeeM68&q=85&s=5abe95512928463f0a9be8f43f787b8d" alt="An active base environment in a VS Code terminal and the hello-env environment as Python interpreter" width="3460" height="1498" data-path="images/conda_tutorial_activate_env.png" />
      </Frame>
    </Note>

    Your Python interpreter is now set to Python 3.14.0 (hello-env).
  </Step>

  <Step title="Import your packages">
    Now that we've set the interpreter, let's import our packages. Add the following to the top of the `factual-cow.py` file:

    ```py theme={null}
    import requests
    import emoji
    import cowsay
    ```

    Select <Icon icon="play" iconType="light" /> **Run** to run the code. If there are no errors in the terminal, your imports were successful.
  </Step>

  <Step title="Write and run code">
    Let's write a simple program that uses all three packages we imported. Add the following code below your import statements:

    <CodeGroup>
      ```py Factual cow code theme={null}
      # Use requests to get a random fun fact from an API
      response = requests.get("https://uselessfacts.jsph.pl/api/v2/facts/random?language=en")
      fact = response.json()["text"]

      # Use emoji to add an emoji
      message = emoji.emojize(f":light_bulb: Did you know? {fact}")

      # Use cowsay to have a cow tell you the fact
      cowsay.cow(message)
      ```

      ```py Full code example theme={null}
      import requests
      import emoji
      import cowsay

      # Use requests to get a random fun fact from an API
      response = requests.get("https://uselessfacts.jsph.pl/api/v2/facts/random?language=en")
      fact = response.json()["text"]

      # Use emoji to add an emoji
      message = emoji.emojize(f":light_bulb: Did you know? {fact}")

      # Use cowsay to have a cow tell you the fact
      cowsay.cow(message)

      ```
    </CodeGroup>

    Select <Icon icon="play" iconType="light" /> **Run** to run the code. Your terminal will display a fun fact from a knowledgeable cow!

    <Frame>
      <img src="https://mintcdn.com/anaconda-29683c67/Q0l5wcbOQ1FeeM68/images/conda_tutorial_cow.png?fit=max&auto=format&n=Q0l5wcbOQ1FeeM68&q=85&s=8e891b4941d911e629e5b4a67312161f" alt="VS Code UI with Python code and terminal showing an ASCII cow saying, 'Did you know? The only nation whose name begins with an A but doesn't end in an A is Afghanistan.'" width="3460" height="1472" data-path="images/conda_tutorial_cow.png" />
    </Frame>
  </Step>
</Steps>

<LearnMore>
  Review the following resources to learn more about the topics covered in this section, or continue on to the next section.

  * [Python environments in VS Code](https://code.visualstudio.com/docs/python/environments)
  * [Run Python code in VS Code](https://code.visualstudio.com/docs/python/run#_run-python-code)
</LearnMore>

## Tutorial wrap up

Congratulations! You've just created your first conda environment, installed packages using both conda and pip, and used your environment in VS Code to run Python code.

If you want to clean up after completing this tutorial, you can delete the `hello-env` environment.

<Steps>
  <Step title="Open Anaconda Prompt or Terminal">
    Return to Anaconda Prompt (Windows) or Terminal (macOS/Linux).

    <Tip>
      Terminal is your system's terminal application, not VS Code's terminal.
    </Tip>
  </Step>

  <Step title="Deactivate your environment">
    First, deactivate your `hello-env` environment:

    ```sh theme={null}
    conda deactivate
    ```
  </Step>

  <Step title="Delete your environment">
    Then, delete the hello-env environment:

    ```sh theme={null}
    conda remove --name hello-env --all
    ```

    The `hello-env` environment is deleted and <Tooltip tip="Removes the environment path from the list of known environments in environments.txt.">deregistered</Tooltip>.
  </Step>
</Steps>

**What you learned**

* How to create and activate conda environments
* How to install packages from conda-forge and PyPI
* How to configure VS Code to use your environment
* How to make a cow tell you fun facts
* How to delete an environment

**Next steps**

* The [Concepts](/getting-started/concepts/what-is-conda) section is a great place to learn the basics of the conda ecosystem.
* The [Conda Basics](https://learning.anaconda.com/courses/conda-basics) course teaches you to manage conda environments, use common commands, and work with channels.
* The [Working with conda](/getting-started/working-with-conda/main) section offers more in-depth documentation on how to use conda.
* The [official conda site](https://docs.conda.io/projects/conda/en/stable/index.html) provides an even deeper level of technical detail on conda's use, as well as a full [index](https://docs.conda.io/projects/conda/en/stable/commands/index.html) of conda commands.
* The [IDE guides](/getting-started/guides/ides/main) offer step-by-step instructions on how to use conda with other popular IDEs like PyCharm and JupyterLab.

**Have feedback?**
Use the <Icon icon="thumbs-up" iconType="light" aria-label="thumbs up" /> **Yes** or <Icon icon="thumbs-down" iconType="light" aria-label="thumbs down" /> **No** feedback buttons below to let us know what you thought about this tutorial and help us improve.
