Virtual Environments With virtualenvwrapper for windows

Photo by Sergey Zolkin on Unsplash

If you are a python developer, you would have faced some situations where you spend hours installing the libraries you need, only to find you have broken some piece of code you have already written. Sometimes certain packages support only some specific version, which may conflict with your other codes.

The solution is to create a virtual environment where you can play around by keeping the packages detached from your code's rest. This post will help you in setting up a virtual environment. These instructions are for Windows.

Step 1: Install the python virtual environment package.

Let’s first install the python package required.

pip install virtualenvwrapper-win

Step 2: Creating an environment

Run the below command to create a new environment where env_name specifies the name of the environment you want to create.

mkvirtualenv env_name

Step 3: Activating the environment

To activate the environment, use the below command.

workon env_name

After running, make sure the environment name is mentioned before the path, as shown in the image below.

Step 4: Deactivating the environment

To exit from the environment, use the below command.

deactivate

Listing the environments created

To list all the environments installed, you can use,

lsvirtualenv

For creating virtual environments in an anaconda and use it inside jupyter, see here.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The end of a turbulent affair

Dev-Op’s Journal

AWS- EKS

Single Tenant vs. Multi-Tenant Database: The Differences and Effects on Embedded BI

Yurbi - Single-Tenant and Multi-Tenant Embedded Analytics

Social Activity for SpicySwap

The future of cross-platform?

124. Binary Tree Maximum Path Sum

Supersize your SuperSaaS with Integromat

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sachinjose

Sachinjose

More from Medium

Sonification 101: How to convert data into music with python

Picture of Matt with dog Marty with code and the Moon in the background. Large text says “Turn Data Into Music With Python!

“Take Me Out to the Ball Game” Algorithmically Remastered in Python

How to export excel properly with Flask and Ajax Call

Your first language using ANTLR