If you are starting from Jiango, you are one of the first steps to hear about you Activating virtual environment. And if it looks a little technical, don’t worry-I’m going to walk exactly what it means, why it makes a difference, and without any confusion, how to step step by step.
I have helped many people start with Azgar and Jiango, and have trusted me: Understanding the virtual environment initially can save you a ton of headaches later.
A virtual environment can help you maintain your Jingo projects. It also avoids disputes between different versions of the packages, and provides you with a clean way to manage your development tools.
By the end of this guide, you will not only know how to activate your virtual environment, but also why you need.
Let’s enter it.
Here’s what we will cover is:
What is the virtual environment in Azar?
The virtual environment is just like private work space for your project. Instead of installing a global package (such as Jiango) for your entire computer, you install them inside this small bubble. In this way, different projects do not mess up with each other.
Imagine that you are working on two Jiango projects: one needs Jiango 3.2 and the other needs Jiango 4.1. Without a virtual environment, you will be involved in version disputes. But with the virtual environment, each project remains separate and clean.
Why use a virtual environment?
Why here? Always Use one while working with Jiango:
The dependence on your plan is isolated.
Prevents version disputes between different projects.
Makes it easy to manage and install packages.
The most important thing, Jiango expects herEspecially if you want to follow the best methods.
How to compose and activate Jiango Virtual environment
Let’s go to the process from the beginning to the end.
1. Install Azigar (if you don’t have yet)
You need to have 3.8 or after. You can check which version do you have by opening your terminal and typing:
python --version
If you look something like that Python 3.11.7You are good
If you do not have azagar, download it here:
Be sure to check the box “Add to the pitcher” During installation if you are on Windows.
2. Install virtualenv (Optional but able to know)
Azigar contains a built -in tool called venvAnd this is what they will use in the tutorial.
However, some developers prefer virtualenv Because:
It works with the old -fashion version
It can be slightly faster in a large environment
It offers some extra flexibility
To install virtualenv Just drive:
pip install virtualenv
Note: You don’t need virtualenv For this tutorial, but it’s good to know about it. We will use the built -in venv Looking forward
3. Create a virtual environment
Now go to your Jiango Project folder (or make a):
mkdir my_django_project
cd my_django_project
Then run away:
python -m venv venv
It makes a folder called venv/ In your project directory. This folder contains everything in your virtual environment.
4. Activate virtual environment
Here is the part that everyone asks.
Activation depends on your operating system.
On Windows (CMD):
venv\Scripts\activate
On Windows (Power Shell):
.\venv\Scripts\Activate.ps1
On Mac or Linux:
source venv/bin/activate
After it is activated, your terminal signal will change. It would look like something like this:
(venv) your-computer-name:my_django_project username$
They (venv) Initially, this means that the virtual environment is active.
What can you do after it is activated?
Now that it is active, you can only install Jiango (or something else) for this project:
pip install django
It installs Jiango within the virtual environment, not globally.
Double check:
pip list
You will see Jiango and any other installed package listed there.
How to disable virtual environment
When you’re working, just type:
deactivate
Just Your terminal comes to normal, and your system is no longer connected to the project.
Normal questionnaire
Do I need to activate the environment every time?
Yes, whenever you open a new terminal session and want to work on your Jiango Project, reactivate it using a command for your OS.
If activate Don’t work?
If you are on Windows, the power shell can stop the script. Run it:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then try to activate.
Can I use the VS code or any other editor with it?
Exactly the VS code automatically detects your virtual environment. You can select the spokesperson from the bottom left or pressed Ctrl+Shift+P → “Izgar: Select the spokesperson.”
The bonus points
Add A .gitignore File
If you are using the gut, you don’t want to upload venv Gut hub folder. Add this line to your .gitignore File:
venv/
Use requirements.txt
Once you install your project packages, freeze them like this:
pip freeze > requirements.txt
Then later, you (or someone else) may install with them:
pip install -r requirements.txt
It is useful for team projects or to move your app to the server.
Conclusion
It looks like a small thing to activate your Jiango Virtual environment, but this is a huge step toward becoming a trusting and organized developer.
Once you get the execution of it, it becomes a second nature – and your future will thank you for learning properly from the beginning.
Would you like to contact me? You can do that x.com/_udemezue
Auctional resources
Learn more
If you are serious about Jiango, here are some free and paid resources I suggest: