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 managementDuration: 20 minutes
Prerequisites and requirements
Before you begin, make sure you have an internet connection and the following software installed on your machine:- Conda
- Visual Studio Code, also known as VS Code, a popular from Microsoft
- Microsoft’s Python extension for VS Code
- Some familiarity with using a command line interface
Creating your project’s conda environment
The conda installation process creates an environment calledbase, 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 .
1
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.
- Windows
- macOS/Linux
To open Anaconda Prompt, type “Anaconda Prompt” in the Windows search bar, then select Anaconda Prompt.

2
Create a new environment
Use the copy button to copy the following command, paste it into your shell application, and press Enter (Windows)/ Return (macOS/Linux) to run it:
The
--name flag sets the new environment’s name.3
Activate your new environment
You’ll need to activate your newly created environment before you can use it. Run the following command to activate Conda displays the currently active environment in your shell application beside the input line:Your new project’s environment is now active!
hello-env:- Windows example
- macOS/Linux example
Learn more
Review the following resources to learn more about the topics covered in this section, or continue on to the next section.
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.1
Add conda packages
We can find the additional conda packages that we need for our project on the conda-forge community channel.Our project requires the The
requests and emoji packages. Install the packages and their dependencies:The
--channel flag tells conda to give the specified channel top priority for installing packages and their dependencies.requests and emoji Python packages are now available in your environment.2
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 Your
hello-env environment.Use pip to install cowsay from PyPI:hello-env environment now includes Python 3.14, requests, emoji, cowsay, and all their dependencies.Learn more
Review the following resources to learn more about the topics covered in this section, or continue on to the next section.
Using your project’s environment in VS Code
1
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.
Press Ctrl+S (Windows/ Linux) or Cmd+S (macOS) to open the Save As… dialogue and save your new file as

factual-cow.py.2
Set the interpreter
Next, select 
Your Python interpreter is now set to Python 3.14.0 (hello-env).
hello-env as the file’s Python interpreter.To set the interpreter, select the interpreter button in the bottom right corner, then select Python 3.14.0 (hello-env) from the dropdown:
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.
3
Import your packages
Now that we’ve set the interpreter, let’s import our packages. Add the following to the top of the Select Run to run the code. If there are no errors in the terminal, your imports were successful.
factual-cow.py file:4
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:Select Run to run the code. Your terminal will display a fun fact from a knowledgeable cow!

Learn more
Review the following resources to learn more about the topics covered in this section, or continue on to the next section.
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 thehello-env environment.
1
Open Anaconda Prompt or Terminal
Return to Anaconda Prompt (Windows) or Terminal (macOS/Linux).
2
Deactivate your environment
First, deactivate your
hello-env environment:3
Delete your environment
Then, delete the hello-env environment:The
hello-env environment is deleted and .- 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
- The Concepts section is a great place to learn the basics of the conda ecosystem.
- The Working with conda section offers more in-depth documentation on how to use conda.
- The official conda site provides an even deeper level of technical detail on conda’s use, as well as a full index of conda commands.
- The IDE tutorials offer step-by-step instructions on how to use conda with other popular IDEs like PyCharm and JupyterLab.