
Tunneling Like a Boss: NordVPN Setup for Kali
June 16, 2025
How to Install Apache, MySQL, and PHP on Ubuntu 24.04 LTS
June 17, 2025How to Create a Python Virtual Environment
When you’re building tools, scripts, or testing code, especially for security work, you don’t want your global Python install getting bloated or conflicting with random libraries. That’s where Python virtual environments come in.
A virtual environment gives you a clean, isolated sandbox for your Python project. Different versions of packages, dependencies, tools and no conflicts with your system Python. You can have multiple environments on the same machine each with their own dependencies.
1. Check Python is installed
Most systems already have Python 3 installed. To check:
If you see something like Python 3.x.x
, you’re good. If not, install it using your system package manager.
2. Install venv (if needed)
In most modern Python installs, venv
comes bundled. But if you’re missing it:
3. Create your virtual environment
Navigate to your project folder or create one:
Now create the venv:
This will create a folder called venv
inside your project. You can call it whatever you want (env
, .venv
, etc), but venv
is common.
4. Activate the virtual environment
On Linux/macOS:
On Windows:
Once activated, your shell prompt will show (venv)
to indicate you’re inside the environment.
5. Install packages inside your venv
Now you can safely install packages without touching system Python:
Everything stays local to your venv.
6. Deactivate when you’re done
This drops you back into your system Python.
7. Bonus tip — freeze your packages
You can snapshot your environment to a requirements.txt
file:
Later you can recreate the same environment:
Why use venv?
• Keeps your system clean
• Avoids package version conflicts
• Lets you build project-specific environments
• Essential for pen-testing tool development, automation scripts, and bug bounty work
⭐ Ready for a reliable, high-performance VPS at an unbeatable price? We host our own Kali labs on Hostinger: 4 vCPU, NVMe storage, 16 GB RAM and 16 TB bandwidth, backed by 24/7 support and a 30-day money-back guarantee. You’ll save up to 20% when you lock in a 24-month plan. Grab a Hostinger VPS using this referral link and support our content.
🚀 Claim Your Hostinger VPS Now (from only US$ 7.99/mo)