Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsA Python virtual environment gives a project its own place for installed packages and command-line tools, separate by default from other projects and the base Python installation’s packages. That separation lets different projects use different versions of a dependency without changing each other. For most projects that use third-party packages, create an environment with Python’s built-in venv module, install packages through that environment’s Python, and keep a separate record of dependencies so you can rebuild it.
What a Python virtual environment is—and what it isolates
A virtual environment is a directory created from an existing Python installation. It contains an environment-specific Python interpreter and its own location for installed packages and scripts. The Python Software Foundation describes venv environments as lightweight, with independent sets of packages in their “site” directories (Python 3.14.7 venv documentation).
As an Amazon Associate I earn from qualifying purchases.
It is not a separate operating system, nor does it install or select the base Python version for you. It isolates project packages by default: a package installed in one environment will not ordinarily be available to another environment or to the base installation. As a result, two projects can use different versions of the same library.
This is useful when one project depends on a particular library version and another needs a different one, or when you want to try an upgrade without changing packages used by other work. The Python Packaging Authority recommends using a virtual environment when working with third-party packages (Install packages in a virtual environment using pip and venv).
#1 Best Overall
Create an environment for a project
Open a terminal in the project directory and run the command for the Python interpreter you want to use as the base:
python -m venv .venv
The command runs the venv module using the interpreter named python in that shell. If you have multiple Python versions installed, choose the intended interpreter explicitly. The Packaging User Guide gives these common alternatives:
- Unix or macOS:
python3 -m venv .venv - Windows:
py -m venv .venv
Here, .venv is the environment directory name; using a project-local directory makes the setup easy to identify. The directory is created if needed and populated with environment files. If the command fails because venv is unavailable in your Python installation, consult the installation instructions for that Python distribution.
Recommended Free Tools
Rank #2
Activate it, or call its Python directly
Activation is optional. It is a shell convenience that puts the environment’s executable directory first on PATH, so commands such as python and pip resolve to the environment. The following commands cover bash or zsh on Unix/macOS and Windows Command Prompt:
# Unix/macOS with bash or zsh
source .venv/bin/activate
# Windows Command Prompt
.venvScriptsactivate
PowerShell, fish, and csh use different activation scripts; use the official venv reference for the command appropriate to your shell.
To verify which interpreter will run, use which python on Unix/macOS or where python in Windows Command Prompt. After activation, the path should point inside .venv. The environment variable VIRTUAL_ENV is set by activation, but it is not a reliable way to determine whether an environment is in use: direct interpreter calls work without activation.
You can bypass activation and invoke the environment’s interpreter by its path:
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall- POSIX systems:
.venv/bin/python - Windows:
.venvScriptspython.exe
This direct form is useful in scripts and automation because it makes the interpreter choice explicit. To leave an activated environment, run deactivate or close the shell.
Install packages into the environment’s Python
With the environment active, install a package using:
python -m pip install package-name
Using python -m pip ties the installer to the Python interpreter named python, reducing the chance that a standalone pip command installs into a different Python installation. If you are not activating the environment, use its interpreter directly:
.venv/bin/python -m pip install package-name
On Windows, use .venvScriptspython.exe -m pip install package-name. Replace package-name with the package you need. By default, packages installed this way belong to this environment, not to every Python project on the computer.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Record dependencies so you can rebuild the setup
The environment directory is disposable; the project’s dependency declaration is what lets you recreate its package setup. The Python Packaging Authority documents requirements files for recording and reinstalling packages in its Installing Packages tutorial. A common workflow is to keep a requirements file with the project and install from it in a newly created environment:
Best Value
python -m pip install -r requirements.txt
Keep the dependency record under version control, but do not commit .venv. If the project is moved or checked out at a new path, create a fresh environment there and reinstall the recorded dependencies. Environments are generally not portable: installed scripts can contain absolute paths to the environment’s interpreter, so moving the directory may leave them pointing to the old location.
What virtual environments do not do
- They do not choose a Python version. The environment is built from the interpreter that runs
python -m venv; install or select the desired base Python separately. - They do not necessarily include every packaging tool. The Python 3.14.7 documentation notes that
setuptoolshas not been a corevenvdependency starting with Python 3.12, so do not assume a new environment contains it. - They are not always isolated from base packages. The default is isolation, but the
--system-site-packagesoption changes that behavior. - They do not require activation. Directly calling the environment interpreter uses it without changing the shell’s command lookup.
When a basic venv is enough
For a single project, venv plus pip and a dependency record is usually a straightforward way to separate packages and recreate the setup. The Packaging User Guide also notes that managing many environments directly can become tedious and points readers toward higher-level tools (Installing Packages tutorial). That is an optional next step for more complex workflows, not a prerequisite for using a virtual environment.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.




