
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:
python3 --version
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:
sudo apt install python3-venv
3. Create your virtual environment
Navigate to your project folder or create one:
mkdir myproject cd myproject
Now create the venv:
python3 -m venv 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:
source venv/bin/activate
On Windows:
venv\Scripts\activate
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:
pip install requests
Everything stays local to your venv.
6. Deactivate when you’re done
deactivate
This drops you back into your system Python.
7. Bonus tip — freeze your packages
You can snapshot your environment to a requirements.txt
file:
pip freeze > requirements.txt
Later you can recreate the same environment:
pip install -r requirements.txt
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
Want to build your own Kali pentest lab like we do? Stop waiting around for shared labs or limited sandboxes. Spin up your own dedicated VPS, fully private, fully controlled, ready to run real-world tools without limits.
We run our Kali labs on Hostinger because you get serious hardware for the price: 4 vCPU, NVMe storage, 16 GB RAM, 16 TB bandwidth, and 24/7 support. No overcrowded boxes, no resource throttling, just clean metal. Lock in a 24-month deal and save up to 20 percent. You’ll be fully operational for under 10 dollars per month.
👉 Launch your own Kali lab now (from only US$ 9.99/mo)