Creating Your Project Folder
Start by organizing your workspace from day one:
- Create a folder named
AI Agent Development - Open it in Visual Studio Code:
- Go to
File→Open Folder - Select your
AI Agent Developmentfolder - Confirm it appears in the Explorer panel on the left
- Go to
For a complete guide on installing VS Code and other essential tools from scratch, check out Free AI Development Setup: Install Python, VS Code & Ollama Tools.
Why You Need a Virtual Environment
Without a virtual environment, all your Python projects share the same global library folder. This causes conflicts:
- Example: Project A uses library version 1; Project B updates it to version 2
- Result: Project A breaks because its code wasn't designed for the update
A virtual environment solves this by:
- Creating a fresh, isolated Python installation inside your project folder
- Storing a separate copy of libraries in that project folder
- Preventing libraries from different projects from interfering with each other
Beginner note: You don't need to fully understand this now, just follow the steps, and it will make sense as you code more.
How to Create and Activate the Virtual Environment
Step 1: Open the Integrated Terminal
In VS Code, open the terminal from the menu or use the shortcut `Ctrl + `` (backtick).
Step 2: Create the Environment
Run this command in the terminal:
python -m venv .venv
This creates a hidden folder named .venv inside your project.
Step 3: Activate the Virtual Environment
- On Windows:
.venv\Scripts\activate - On Linux/macOS:
source .venv/bin/activate
When activated, you'll see a prompt change, something like (.venv) at the beginning of your terminal line. This shows you're now using the isolated environment.
Troubleshooting Activation Errors
If activation fails on Windows:
- Run the command from Windows Command Prompt or PowerShell (outside VS Code)
- Close that window, reopen VS Code, and try again
What Happens Next?
- Any libraries you install now go into your project's
.venvfolder, not the system-wide Python folder - Your project stays self-contained and portable
- You can have different library versions for different projects without conflicts
Once your environment is ready, you can start building projects like your own AI assistant. Learn how in Build Your Own ChatGPT: Python AI Assistant Explained.
Run the activation command every time you open a new terminal in this project.
So, now start building your application. So, what is the first step is create your project folder. We want to
organize everything perfectly from the day one. So, create a folder named AI Agent
Development. So, this is the name of the folder which we will create. After you have created this folder,
you open the project in the Visual Studio Code. So, you open Visual Studio Code and select file open folder.
That means you will go to the file menu, open folder, and select that particular folder, AI Agent Development folder.
You should see now this folder in the Explorer panel on the left. We will see this into the demonstration also.
Now, the next thing we have to do is create a virtual environment. A virtual environment
keeps the libraries for this project separate from the other Python projects on your computer.
So, we'll try to understand clearly, but I also want to tell even if you don't understand it right now, there is no
issue with it. You will be able to run the program even if it is not clear to you. Later, it will be clear to you once
you are comfortable with the programming. So, what happens normally without a
virtual environment? So, suppose you do not create any virtual environment, what happens?
So, suppose this is your computer, and you have you are developing two projects. So, this is project A folder,
this is project B folder, and you have written certain Python program into this. This program is written inside
this folder, this program is written inside this folder. Now, when you write any program in
Python, it uses some libraries. Libraries means already built-in function, which you can directly
utilize. If you don't understand library right now, it is it is not an issue at all. We will later on see what a library
is, what a function is. So, just try to understand that there are some components which is
already available in the Python, and we utilize those components. Right? Now, I think that is clear.
Now, what Python does is it is stores those common components in a hidden folder
here somewhere. Now, generally these libraries may have version as they keep on updating.
Somebody has made that library. So, it will have some version, and people keep on updating that version.
Now, suppose you used this particular version. That means version one.
And he when he wrote the program, he wanted to use the version two. So, if this library is
changed from version one to version two, this particular program will not run because it was written using the version
one library functions. So, that is the disadvantage of not creating a virtual environment.
So, because this hidden system folder is shared, project A and project B are forced to use the exact same libraries.
If project B updates that library to version two, project A might break because its code was not designed for
the update. So, this program may not work because it was designed for version one, but somebody changed the library to
the version two. So, therefore, we create a virtual environment. So, what a virtual
environment actually does? When you create a virtual environment, it physically copies a fresh mini
version of Python and a brand new empty library folder directly inside your project folder. So, now there is nothing
common library, rather than your folder has a folder a small folder inside it, which contains its own library.
And the second project, it has also a folder which contains its own libraries. So, it may have version one library, it
may have version two libraries, it will not conflict, so both the program will work. So, now the libraries are
literally sitting inside the separate project folders. They are completely locked away from
each other. Therefore, they will not disturb each other. So, how to create the virtual
environment? Open the integrated terminal in the VS code.
So, in the VS code software, you open the terminal. I will show it in the demonstration also. And then you run
python {minus} m venv.venv. This is the command which you will run on the terminal.
This creates a new folder named {dot} venv. So,
this has created a new folder. Now, you have to activate the virtual environment. For ac-
activating the virtual environment, you run this command on Windows and this command on Linux.
So, this is the command which you will run. If this command run properly and the
activation happened, then you will see something like this at the beginning of your terminal prompt.
So, earlier you may be seeing the name of the folders at the terminal prompt. Now, you will see
this at the terminal prompt and that tells you that the virtual environment has been activated.
For example, suppose right now you don't understand what is the need of the virtual environment, then do not worry.
Just run this and this these two commands on the terminal prompt of Visual Studio Code and the virtual
environment is created. Later on, when you will be able to understand the libraries and functions better, you will
understand what was the use of the virtual environment. And suppose when you try to activate
and you did not get this, you did not get this, then that means it is not activated
and there is an error which it will show. So, if you will get an error, then you have to run this command from the
command prompt or the PowerShell of the Windows. Once you run this command and then you close it, thereafter again go
to the Visual Studio Code and run this, then it will run properly. Only if you get an error. If you don't get
[clears throat] any error, then it is done. But, if you get an error, then you have to run this command from the
command prompt. Now, the question is why the terminal prompt changes?
Because you now have multiple copies of Python on your computer, you have to tell your terminal which one to use.
When you turn on the environment for project A, your terminal prompt changes to project A environment.
Just to show you, any library you install right now will go inside project A's folder, not
the hidden system folder. So, whenever you will download or install any library which we require to use in your program,
now it will go inside your project folder. It will not go to the common folder. So, that is the main advantage
of using the virtual environment. I hope this is clear to you. Even if it is not clear to you, just go and create
the virtual environment. Later at some point of time, I will explain it again to you.
I hope it is clear. Thank you.
Creating a folder like AI Agent Development helps you organize your workspace from day one. By opening this folder in VS Code using File → Open Folder, you ensure that all your code, files, and settings are contained in one place. This prevents clutter and makes it easier to manage dependencies, share projects, and troubleshoot issues later.
A virtual environment creates an isolated Python installation inside your project folder. Without it, all projects share the same global library folder, which can cause conflicts—for example, Project A requires library version 1, but Project B updates it to version 2, breaking Project A. Using a virtual environment ensures each project has its own set of libraries, preventing interference and keeping your code portable and reliable.
First, open the integrated terminal in VS Code (Ctrl + ``). Then run the command python -m venv .venvto create a hidden folder named.venv` inside your project. This folder contains a fresh Python installation where you can install libraries without affecting other projects.
The activation command varies by OS: On Windows, use .venv\Scripts\activate (from Command Prompt or PowerShell). On Linux or macOS, use source .venv/bin/activate. After activation, you’ll see (.venv) at the beginning of your terminal line, confirming you’re inside the isolated environment.
If activation fails on Windows, try running the command from the Windows Command Prompt or PowerShell outside of VS Code. After a successful activation there, close that window, reopen VS Code, and attempt activation again. This often resolves VS Code-specific path issues.
When the environment is active, your terminal prompt will change to include (.venv) at the beginning. This indicates that any pip install commands will now install packages into the .venv folder instead of the system-wide Python directory. Your project remains self-contained, and you can have different library versions for different projects without conflicts.
Yes, you must run the activation command each time you open a new terminal for that project. This ensures you are using the project’s isolated environment and not the global Python installation. It’s a quick step that prevents library conflicts and keeps your development workflow consistent.
Keep this summary
Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.
Save to LunaNotesOr summarise for another video.
32K+ people have turned 65K+ videos into notes
“Very useful tool. I'm using it for the last couple weeks and I'm loving it so far. Makes learning on YouTube a great experience.”
This summary and transcript were automatically generated using AI with the Free YouTube transcript summary tool by LunaNotes.
Related summaries
Install Python, VS Code, and Ollama for AI Agent Development
This video provides a step-by-step guide to setting up your development environment for building AI agents. Learn how to install Python, download and configure Visual Studio Code, and set up Ollama with large language models.
Free AI Development Setup: Install Python, VS Code & Ollama Tools
Learn how to set up a complete local AI development environment using three free tools. This guide covers Python installation, Visual Studio Code setup, and Ollama for running AI models on your own computer — no GPU or cloud costs required.
How to Configure AI Model Settings for Your First Python Program
Learn to set up a configuration file (.env) for your AI program, including base URL, API key, and model name. This tutorial shows how to configure Ollama locally so your Python code can communicate with an AI model without hardcoding settings.
How to Write Your First AI Program in Python with Ollama
Learn to write a simple AI-powered Python program that communicates with a local AI model (Ollama). This step-by-step tutorial covers importing libraries, loading environment variables, connecting to the AI, sending a question, and displaying the response.
Getting Started with Java: Writing Your First Code in VS Code
In this tutorial, we explore how to set up Visual Studio Code for Java development and write your first Java program. We cover the basics of creating a project, using the terminal, and writing a simple 'Hello World' program.
Most viewed summaries
A Comprehensive Guide to Using Stable Diffusion Forge UI
Explore the Stable Diffusion Forge UI, customizable settings, models, and more to enhance your image generation experience.
Kolonyalismo at Imperyalismo: Ang Kasaysayan ng Pagsakop sa Pilipinas
Tuklasin ang kasaysayan ng kolonyalismo at imperyalismo sa Pilipinas sa pamamagitan ni Ferdinand Magellan.
Mastering Inpainting with Stable Diffusion: Fix Mistakes and Enhance Your Images
Learn to fix mistakes and enhance images with Stable Diffusion's inpainting features effectively.
Pamamaraan at Patakarang Kolonyal ng mga Espanyol sa Pilipinas
Tuklasin ang mga pamamaraan at patakaran ng mga Espanyol sa Pilipinas, at ang epekto nito sa mga Pilipino.
How to Install and Configure Forge: A New Stable Diffusion Web UI
Learn to install and configure the new Forge web UI for Stable Diffusion, with tips on models and settings.
Found this summary useful?
Take it with you. One click puts it in your own LunaNotes library.
Save to LunaNotes