Fundamentals 6 min read

Build a Simple Python Virtual Environment Manager with virtualenvwrapper

This guide walks you through installing Python, setting up a WORKON_HOME variable, and using a custom Python virtual‑environment manager—covering pip updates, source switching, environment creation, activation, and removal—so you can manage isolated environments without conda.

Python Crawling & Data Mining
Python Crawling & Data Mining
Python Crawling & Data Mining
Build a Simple Python Virtual Environment Manager with virtualenvwrapper

Introduction

The author previously used conda for environment isolation but encountered conflicts when installing additional software, prompting a switch to a pure Python interpreter and the virtualenvwrapper tool. To simplify workflow, a lightweight Python virtual‑environment manager was created and is shared here.

Problem

Using virtualenvwrapper together with virtualenvwrapper‑win involves long commands that are cumbersome for casual users, so a simpler graphical manager was built.

Interface

Usage

1. Install Python

Download and install the 64‑bit Python 3.8.6 interpreter, ensuring the "Add Python to PATH" option is selected.

After installation, running python in the command prompt should start the interpreter without errors.

2. Create WORKON_HOME system variable

All virtual environments will be stored under the directory referenced by WORKON_HOME. Create a system environment variable with that name pointing to your desired folder.

3. Use the Python manager

After the previous steps, the manager can be used to handle virtual environments.

Update pip

Switch to a permanent mirror source

Install the virtual‑environment package

If a command prompt reports "not recognized as an internal or external command", ignore it and retry; the error disappears after the first successful run.

3.1 Create an environment

Run the command mkvirtualenv <env> to create a new environment.

3.2 Activate an environment

Use workon <env> to open a command window already inside the specified virtual environment, allowing immediate use of pip without extra steps.

3.3 Delete an environment

Run rmvirtualenv <env> to remove the chosen environment.

Conclusion

The manager is a lightweight tool created for personal convenience and to help peers manage Python virtual environments more easily; it works well on Windows 10 and, with minor visual quirks, on Windows 7 as well.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Tutorialenvironment managementvirtualenvvirtualenvwrapper
Python Crawling & Data Mining
Written by

Python Crawling & Data Mining

Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.